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
HTTP/2 usage and Windows support? #4
Comments
This is interesting, I think if you rollback to version 0.2.4 and confine yourself to a single worker (the default) it will work. I've some issues to fix with Windows and multiple workers (especially with the 0.3.x releases). |
Thanks, I can confirm that works. Command line from the gunicorn tutorial, slightly modified. hypercorn --workers 1 --keyfile key.pem --certfile cert.pem --ciphers ECDHE+AESGCM --bind localhost:5000 http2test:app |
I think I've fixed this on the master branch, would you be able to try it and confirm? |
I can confirm HTTP2 on Windows is working in '0.3.2' when restricted to 1 worker. |
I think this is good with 0.4.1, please reopen if not. |
Just confirming 1 worker is still fine, but 2 or more crashes. |
I can't reproduce the crash, do you have a stack trace? |
Here's my start command And the stack trace``` hypercorn --workers 2 --keyfile key.pem --certfile cert.pem --ciphers ECDHE+AESGCM --bind localhost:5000 http2test:app
|
Hmm, this is a very difficult bug, I can only reproduce it intermittently - I think there is a race issue when creating servers (sockets) at the same time on windows. I think this commit, 693093f, works around this. Could you try it? |
Just tested this and while at first it didn't help, I increased the delay however to time.sleep(1.0 * random.random()) and then it started working intermitently. Increasing the worker count appears to make it fail more often still even with the higher delay. It's somewhat functional now though. |
Could you try with the |
I just downloaded those three changed files manually and applied them, the behaviour was different but it crashes. Behaviour Here's the error. |
Interesting, looks like the same issue but after a new delay. This is maybe not a race condition then, although the intermittent nature suggests so... |
Hi
I just found your excelent tuturial on how to use Quart with gunicorn, which I know isn't supported on Windows 10 so decided to attempt to use hypercorn instead. Unfortunately it's crashing giving this error.
hypercorn --keyfile key.pem --certfile cert.pem --ciphers ECDHE+AESGCM --bind localhost:5000 http2test:app
Running on https://localhost:5000 (CTRL + C to quit)
Traceback (most recent call last):
File "c:\users\x\appdata\local\programs\python\python37-32\Lib\runpy.py", line 193, in run_module_as_main
"main", mod_spec)
File "c:\users\x\appdata\local\programs\python\python37-32\Lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "C:\Users\x.virtualenvs\QuartTest-s-3dKnLB\Scripts\hypercorn.exe_main.py", line 9, in
File "c:\users\x.virtualenvs\quarttest-s-3dknlb\lib\site-packages\hypercorn_main.py", line 159, in main
run_multiple(config)
File "c:\users\x.virtualenvs\quarttest-s-3dknlb\lib\site-packages\hypercorn\run.py", line 234, in run_multiple
process.start()
File "c:\users\x\appdata\local\programs\python\python37-32\Lib\multiprocessing\process.py", line 112, in start
self._popen = self._Popen(self)
File "c:\users\x\appdata\local\programs\python\python37-32\Lib\multiprocessing\context.py", line 223, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File "c:\users\x\appdata\local\programs\python\python37-32\Lib\multiprocessing\context.py", line 322, in _Popen
return Popen(process_obj)
File "c:\users\x\appdata\local\programs\python\python37-32\Lib\multiprocessing\popen_spawn_win32.py", line 65, in init
reduction.dump(process_obj, to_child)
File "c:\users\x\appdata\local\programs\python\python37-32\Lib\multiprocessing\reduction.py", line 60, in dump
ForkingPickler(file, protocol).dump(obj)
TypeError: can't pickle SSLContext objects
Traceback (most recent call last):
File "", line 1, in
File "c:\users\x\appdata\local\programs\python\python37-32\Lib\multiprocessing\spawn.py", line 99, in spawn_main
new_handle = reduction.steal_handle(parent_pid, pipe_handle)
File "c:\users\x\appdata\local\programs\python\python37-32\Lib\multiprocessing\reduction.py", line 87, in steal_handle
_winapi.DUPLICATE_SAME_ACCESS | _winapi.DUPLICATE_CLOSE_SOURCE)
PermissionError: [WinError 5] Access is denied
Is there a working usage example? It's working fine with http1.
Thanks and keep up the great work!
The text was updated successfully, but these errors were encountered: