Git Product home page Git Product logo

Comments (7)

Dreamsorcerer avatar Dreamsorcerer commented on July 18, 2024 1

I'll look at it next week.

from aiohttp-devtools.

Dreamsorcerer avatar Dreamsorcerer commented on July 18, 2024

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.

haukex avatar haukex commented on July 18, 2024

Thanks for the quick reply! I will try debugging a bit further and get back to you.

from aiohttp-devtools.

haukex avatar haukex commented on July 18, 2024

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 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).

  • 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.

Dreamsorcerer avatar Dreamsorcerer commented on July 18, 2024
* 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.

haukex avatar haukex commented on July 18, 2024

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.

haukex avatar haukex commented on July 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.