Comments (10)
@samuelcolvin,
Also, server not responding and not reloading if code changed.
from aiohttp-devtools.
That should be the same problem which is only showed when on shutdown because task.result()
is called.
Two minutes and I'll have a PR to fix this.
from aiohttp-devtools.
should be fixed in #154, would be great if you could check this @achernetsky and if it's ok i'll release again.
from aiohttp-devtools.
I checked and got other problem/issue
$ PYTHONASYNCIODEBUG= adev runserver --root test
[22:38:39] pre-check enabled, checking app factory
[22:38:39] Starting aux server at http://localhost:8001 ◆
[22:38:39] Starting dev server at http://localhost:8000 ●
[22:38:40] ● GET / 200 163B
^C[22:38:42] shutting down server...
Process Process-1:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/process.py", line 249, in _bootstrap
self.run()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/process.py", line 93, in run
self._target(*self._args, **self._kwargs)
File "../venv/lib/python3.6/site-packages/aiohttp_devtools/runserver/serve.py", line 138, in serve_main_app
loop.close()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/unix_events.py", line 63, in close
super().close()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/selector_events.py", line 110, in close
self._close_self_pipe()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/selector_events.py", line 121, in _close_self_pipe
self._ssock.close()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/socket.py", line 417, in close
self._real_close()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/socket.py", line 411, in _real_close
_ss.close(self)
KeyboardInterrupt
Exception ignored in: <bound method BaseEventLoop.__del__ of <_UnixSelectorEventLoop running=False closed=False debug=False>>
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/base_events.py", line 511, in __del__
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/unix_events.py", line 63, in close
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/selector_events.py", line 110, in close
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/selector_events.py", line 120, in _close_self_pipe
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/selector_events.py", line 279, in _remove_reader
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/selectors.py", line 189, in get_key
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/selectors.py", line 70, in __getitem__
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/selectors.py", line 224, in _fileobj_lookup
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/selectors.py", line 41, in _fileobj_to_fd
ValueError: Invalid file descriptor: -1
If I did not send GET request everything alright
$ PYTHONASYNCIODEBUG= adev runserver --root test
[22:43:07] pre-check enabled, checking app factory
[22:43:07] Starting aux server at http://localhost:8001 ◆
[22:43:07] Starting dev server at http://localhost:8000 ●
^C[22:43:08] shutting down server...
$
from aiohttp-devtools.
Does the code reload properly?
from aiohttp-devtools.
@samuelcolvin, yes, and server reloaded if code changed.
$ PYTHONASYNCIODEBUG= adev runserver --root test
[22:43:39] pre-check enabled, checking app factory
[22:43:39] Starting aux server at http://localhost:8001 ◆
[22:43:39] Starting dev server at http://localhost:8000 ●
[22:43:44] Restarting dev server at http://localhost:8000 ●
^C[22:43:46] shutting down server...
$
from aiohttp-devtools.
@samuelcolvin, I think, as I wrote above, problem reproduced if I sent GET request.
from aiohttp-devtools.
ok, try this. I've committed again but annoyingly it still seems to be in github's queue and not showing here.
This works for me most of the time but occationally I get an error on shutdown, I think that's just how it is with uvloop, if you want to be sure of no errors on termination, don't use uvloop with aiohttp-devtools.
from aiohttp-devtools.
@samuelcolvin,
I run with using uvloop
and got same issue.
...
ValueError: Invalid file descriptor: -1
After I run the following code without uvloop
PYTHONASYNCIODEBUG= adev runserver --root test
where test/main.py
from aiohttp import web
import asyncio
# import uvloop
async def handle(request):
return web.Response(text='testing more')
# asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())
app = web.Application()
app.router.add_get('/', handle)
and got
$ PYTHONASYNCIODEBUG= adev runserver --root test
[22:58:51] pre-check enabled, checking app factory
[22:58:51] Starting aux server at http://localhost:8001 ◆
[22:58:51] Starting dev server at http://localhost:8000 ●
[22:58:52] ● GET / 200 163B
^C[22:58:56] shutting down server...
Process Process-1:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/process.py", line 249, in _bootstrap
self.run()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/process.py", line 93, in run
self._target(*self._args, **self._kwargs)
File "../venv/lib/python3.6/site-packages/aiohttp_devtools/runserver/serve.py", line 138, in serve_main_app
loop.close()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/unix_events.py", line 63, in close
super().close()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/selector_events.py", line 110, in close
self._close_self_pipe()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/selector_events.py", line 121, in _close_self_pipe
self._ssock.close()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/socket.py", line 417, in close
self._real_close()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/socket.py", line 411, in _real_close
_ss.close(self)
KeyboardInterrupt
Exception ignored in: <bound method BaseEventLoop.__del__ of <_UnixSelectorEventLoop running=False closed=False debug=False>>
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/base_events.py", line 508, in __del__
AttributeError: 'NoneType' object has no attribute 'warn'
$
from aiohttp-devtools.
see my comments on #154 I'm going to merge than and 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 always run HOT 7
- 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.