I can start up my server, but when I tried to test the Keep-Alive support, the second request blocked and the third request triggered the second request fail.
import requests
s = requests.session()
s.get('http://localhost:5000') # second time will block
I got some log.
[pid: 41413|app: 0|req: 1/1] 127.0.0.1 () {32 vars in 425 bytes} [Thu Jan 17 16:29:40 2019] GET / => generated 12 bytes in 2 msecs (HTTP/1.1 200) 2 headers in 79 bytes (3 switches on core 9)
Traceback (most recent call last):
File "src/gevent/_greenlet_primitives.py", line 60, in gevent.__greenlet_primitives.SwitchOutGreenletWithLoop.switch
File "src/gevent/_greenlet_primitives.py", line 63, in gevent.__greenlet_primitives.SwitchOutGreenletWithLoop.switch
File "src/gevent/_greenlet_primitives.py", line 66, in gevent.__greenlet_primitives.SwitchOutGreenletWithLoop.switch_out
File "src/gevent/_greenlet_primitives.py", line 67, in gevent.__greenlet_primitives.SwitchOutGreenletWithLoop.switch_out
BlockingSwitchOutError: Impossible to call blocking function in the event loop callback
2019-01-17T08:29:44Z
Traceback (most recent call last):
File "src/gevent/greenlet.py", line 711, in gevent._greenlet.Greenlet.join
File "src/gevent/greenlet.py", line 737, in gevent._greenlet.Greenlet.join
File "src/gevent/greenlet.py", line 726, in gevent._greenlet.Greenlet.join
File "src/gevent/_greenlet_primitives.py", line 60, in gevent.__greenlet_primitives.SwitchOutGreenletWithLoop.switch
File "src/gevent/_greenlet_primitives.py", line 64, in gevent.__greenlet_primitives.SwitchOutGreenletWithLoop.switch
File "src/gevent/__greenlet_primitives.pxd", line 35, in gevent.__greenlet_primitives._greenlet_switch
gevent.exceptions.BlockingSwitchOutError: Impossible to call blocking function in the event loop callback
[pid: 41414|app: 0|req: 1/2] 127.0.0.1 () {32 vars in 425 bytes} [Thu Jan 17 16:29:44 2019] GET / => generated 12 bytes in 6 msecs (HTTP/1.1 200) 2 headers in 79 bytes (3 switches on core 9)
I try to run a super simple flask server with --http11-socket and --gevent and failed.
I run with this command:
And my demo server:
Attach my dependence:
I can start up my server, but when I tried to test the Keep-Alive support, the second request blocked and the third request triggered the second request fail.
I got some log.