Comments (7)
I'll look at it next week.
from aiohttp-devtools.
With your example, I get:
======== Running on http://0.0.0.0:8001 ========
(Press CTRL+C to quit)
====> BEFORE
====> STARTUP
^C=====> SHUTDOWN
=====> AFTER
If you want to look at the code and try debugging, cleanup should be run here:
https://github.com/aio-libs/aiohttp-devtools/blob/master/aiohttp_devtools/runserver/serve.py#L135
Though both shutdown and cleanup_ctx are handled in the same call, so you'll likely need to dig into aiohttp to see what's happening. Cleanup_ctx is run at: https://github.com/aio-libs/aiohttp/blob/master/aiohttp/web_runner.py#L325
The previous line (site.stop()
) will run on_shutdown.
from aiohttp-devtools.
Thanks for the quick reply! I will try debugging a bit further and get back to you.
from aiohttp-devtools.
Just some quick initial results:
-
On Linux, I am not able to reproduce the issue with the
master
branch, but I am able to reproduce it withv1.0.post0
, so one of the commits in the meantime seems to have fixed the issue (at the moment I don't have enough time to bisect which one it was). -
On Windows, I am still able to reproduce the issue even with the latest
master
branch. The "AFTER
" is sometimes printed, and sometimes not, but the file is never written - it seems to me like the process is terminating before everything has finished.
Perhaps you could publish a new release, so that the issue is fixed at least on Linux?
from aiohttp-devtools.
* On Linux, I am not able to reproduce the issue with the `master` branch, but I am able to reproduce it with `v1.0.post0`, so one of the commits in the meantime seems to have fixed the issue (at the moment I don't have enough time to bisect which one it was).
Did you checkout the release tag, just to verify it is not some difference between a pip-installed version and a local one?
The only change that I can even remotely imagine affecting this is the switch to asyncio.Runner()
in Python 3.11:
22929a4
from aiohttp-devtools.
Did you checkout the release tag, just to verify it is not some difference between a pip-installed version and a local one?
Yes, it was a checkout of the tag v1.0.post0
, run in a Python 3.11.3 venv
, run via python -c "from aiohttp_devtools.cli import runserver; runserver()" testserv.py
.
Unfortunately I don't know enough about asyncio
yet, I've only been working with it for a month or so, so I can't say much about the runner, other than that I might have the time to run a bisect in the next few days.
from aiohttp-devtools.
Actually, running the bisect wasn't too difficult, and I can confirm that 22929a4 seems to have fixed the issue on Linux.
Is there any chance of a new release?
from aiohttp-devtools.
Related Issues (20)
- [feature-request] Adding additional parameters HOT 2
- Reload on additional file changes HOT 2
- No graceful shutdown when CTRL-C HOT 3
- Auto reload get triggered by Emacs tmp files HOT 2
- Incorrect behavior if __name__ == '__main__': sys.exit(main()) HOT 2
- Remove/enable --boxed
- As of 3.10, the *loop* parameter was removed from Event HOT 2
- Not working with python 3.10 version HOT 2
- v1.0 broken (missing JS)
- How do I use aiohttp-devtools with the PyCharm debugger? HOT 2
- runserver doesn't respect host setting HOT 3
- async_generator object has no attribute lock HOT 3
- logging / log format HOT 5
- Looking to wrong server to find static files. HOT 2
- Cleanup context is not run on reload on Windows HOT 17
- Host setting not respected HOT 2
- Tests leave python processes and an open port behind
- Let's put `aiohttp-devtools` under the `aio-libs` org on PyPI HOT 5
- Import module order issue HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aiohttp-devtools.