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

Make code reloading work #3169

Merged
merged 2 commits into from
Jun 22, 2023
Merged

Make code reloading work #3169

merged 2 commits into from
Jun 22, 2023

Conversation

stchris
Copy link
Contributor

@stchris stchris commented Jun 22, 2023

@monneyboi reported that the reloading feature of flask run wasn't properly working. I'm pretty sure it has to do with the debugger we are trying to attach. In either case enabling earlier fails (instead of trying to fail lazily so a debugger can be shown) fixed the code reloading issue.

@stchris stchris requested a review from monneyboi June 22, 2023 08:06
@tillprochaska
Copy link
Contributor

tillprochaska commented Jun 22, 2023

@stchris Following up on our discussion earlier today, here’s the behavior I observe with these changes:

When running make web / docker compose -f ... up:

  1. Introduce a syntax error and save file
  2. Flask dev server reloads code
  3. Dev server exits due to the syntax error
  4. Docker tries to restart the container
  5. Dev server exists again
  6. Infinite container restart loop

When using docker compose run -f ... api:

  1. Introduce a syntax error and save file
  2. Flask dev server reloads code
  3. Dev server exists due to the syntax error
  4. I need to manually restart the container

Maybe there is another solution to this problem that doesn’t caveats?

@tillprochaska
Copy link
Contributor

Also, is anyone here actually using debugpy? If this only happens when used together with debugpy, we might want to consider simply removing debugpy from the default development setup?

@tillprochaska
Copy link
Contributor

According to microsoft/debugpy#808 disabling only Flask’s debugger might help (if we want to keep support for debugpy)?

@monneyboi
Copy link
Contributor

Also, is anyone here actually using debugpy? If this only happens when used together with debugpy, we might want to consider simply removing debugpy from the default development setup?

This is exactly what i was thinking

@monneyboi monneyboi merged commit 62d0899 into develop Jun 22, 2023
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

Successfully merging this pull request may close these issues.

3 participants