benoitc / gunicorn

gunicorn 'Green Unicorn' is a WSGI HTTP Server for UNIX, fast clients and sleepy applications.
http://www.gunicorn.org
Other
9.87k stars 1.75k forks source link

AttributeError: 'StreamServer' object has no attribute 'handle' #3315

Open wangfengsec opened 1 month ago

wangfengsec commented 1 month ago

Hello all, I have flask-gunicorn api running in docker when concurrent requests are made to an interface in the application the issue is this: AttributeError: 'StreamServer' object has no attribute 'handle' intermittently when concurrent requests are made to an interface in the application

gunicorn==22.0.0 Flask==2.2.5 gevent==23.9.1

startup setting: import multiprocessing from gevent import monkey monkey.patch_all() bind = "0.0.0.0:8080" proc_name = 'gunicorn' workers = multiprocessing.cpu_count() * 2 + 1 worker_class = 'gevent' loglevel = 'info' worker_connections = 1000 max_requests = 1000 max_requests_jitter = 200

python exception trace:

Traceback (most recent call last): File "src/gevent/greenlet.py", line 908, in gevent._gevent_cgreenlet.Greenlet.run File "xxx/site-packages/gevent/baseserver.py", line 34, in _handle_and_close_when_done return handle(*args_tuple) File "xxxx/site-packages/gevent/server.py", line 210, in wrap_socket_and_handle return self.handle(ssl_socket, address) AttributeError: 'StreamServer' object has no attribute 'handle' 2024-10-23T08:27:02Z <Greenlet at 0x7fc507852cc0: _handle_and_close_when_done(<bound method StreamServer.wrap_socket_and_handle , <bound method StreamServer.do_close of <StreamServ, (<gevent._socket3.socket [closed] at 0x7fc50781028)> failed with AttributeError