Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-reloading breaks server if server request is made too quickly after code change #4717

Open
dex-max opened this issue Mar 1, 2025 · 0 comments

Comments

@dex-max
Copy link

dex-max commented Mar 1, 2025

Ktor version/setup
Ktor Project Generator: Ktor 3.1.1, Netty, Gradle Kotlin, Routing plugin

Issue
I am trying to set up a local environment for developing a Ktor application with auto-reloading. The auto-reloading has been working, but it seems like if a code change is made and then a request to the server is sent immediately after before the compiler is finished, the server breaks.

Usually if the auto-reloading works properly, the following lines are outputted:

INFO Application - Changes in application detected.
INFO Application - Application auto-reloaded in 0.019 seconds.

However if the issue is reproduced then only the first line is outputted and the server does not respond to the request.

Steps to reproduce
New Ktor project from Ktor Project Generator with the settings above.
Enable auto-reload following these steps: https://ktor.io/docs/server-auto-reload.html
Run ./gradlew build --continuous and ./gradlew run
Make a change in code to the router
Immediately send a request to the server (you might have to send 2-3 in a row)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant