Skip to content
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

"Error handling request" with Gunicorn and gevent worker #1115

Closed
dsoprea opened this issue Jul 12, 2014 · 1 comment
Closed

"Error handling request" with Gunicorn and gevent worker #1115

dsoprea opened this issue Jul 12, 2014 · 1 comment

Comments

@dsoprea
Copy link

dsoprea commented Jul 12, 2014

I'm using Flask with Gunicorn using the "gevent" worker. The request completes, the client receives the response, and Gunicorn spits out "Error handling request", and then waits for a new request.

This is the stacktrace:

    2014-07-12 18:01:53 [38427] [INFO] Booting worker with pid: 38427
    2014-07-12 18:01:55 [38427] [DEBUG] POST /job/dev/job1
    2014-07-12 18:01:55 [38427] [ERROR] Error handling request
    Traceback (most recent call last):
      File "/Users/dustin/development/python/mapreduce/lib/python2.7/site-packages/gunicorn/workers/async.py", line 116, in handle_request
        raise StopIteration()
    StopIteration

(I should note that this is coming out of the "async" worker module, and not the intended "gevent" one).

This is the relevant portion of that module:

        except Exception:
            if resp and resp.headers_sent:
                # If the requests have already been sent, we should close the
                # connection to indicate the error.
                self.log.exception("Error handling request")
                try:
                    sock.shutdown(socket.SHUT_RDWR)
                    sock.close()
                except socket.error:
                    pass
                raise StopIteration()
            raise
        finally:

I'm a long-time user of Gunicorn, but haven't used Flask very often. I'm guessing that Flask is doing something to have the headers sent back early.

@DasIch
Copy link
Contributor

DasIch commented Jul 27, 2014

This is an issue in gunicorn/gevent.

@DasIch DasIch closed this as completed Jul 27, 2014
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants