Opened 17 years ago
Closed 16 years ago
#7271 closed defect (duplicate)
ERROR: (32, 'Broken pipe') when zipped diff is interrupted (fcgi)
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | web frontend | Version: | |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
I'm seeing this error occaisionally, which as I understand it, is harmless:
Trac[LaserLine:__init__] ERROR: (32, 'Broken pipe') Traceback (most recent call last): File "/afs/acm.uiuc.edu/project/trac/lib/python2.4/site-packages/trac/web/main.py", line 415, in dispatch_request dispatcher.dispatch(req) File "/afs/acm.uiuc.edu/project/trac/lib/python2.4/site-packages/trac/web/main.py", line 246, in dispatch resp = chosen_handler.process_request(req) File "/afs/acm.uiuc.edu/project/trac/lib/python2.4/site-packages/trac/versioncontrol/web_ui/changeset.py", line 249, in process_request self._render_zip(req, filename, repos, diff_args) File "/afs/acm.uiuc.edu/project/trac/lib/python2.4/site-packages/trac/versioncontrol/web_ui/changeset.py", line 613, in _render_zip req.write(buf.getvalue()) File "/afs/acm.uiuc.edu/project/trac/lib/python2.4/site-packages/trac/web/api.py", line 461, in write self._write(data) File "/afs/acm.uiuc.edu/project/trac/lib/python2.4/site-packages/trac/web/_fcgi.py", line 1226, in write req.stdout.write(data) File "/afs/acm.uiuc.edu/project/trac/lib/python2.4/site-packages/trac/web/_fcgi.py", line 328, in write self._write(data) File "/afs/acm.uiuc.edu/project/trac/lib/python2.4/site-packages/trac/web/_fcgi.py", line 312, in _write self._conn.writeRecord(rec) File "/afs/acm.uiuc.edu/project/trac/lib/python2.4/site-packages/trac/web/_fcgi.py", line 706, in writeRecord rec.write(self._sock) File "/afs/acm.uiuc.edu/project/trac/lib/python2.4/site-packages/trac/web/_fcgi.py", line 543, in write self._sendall(sock, header) File "/afs/acm.uiuc.edu/project/trac/lib/python2.4/site-packages/trac/web/_fcgi.py", line 520, in _sendall sent = sock.send(data) error: (32, 'Broken pipe')
This occurs when someone selects a zipped diff between two changesets, and closes the connection before the download completes.
There appear to be a few tickets related to the fcgi backend and the 'Broken pipe' error; perhaps the try/except block for this should be moved to somewhere where it catches the general case, if possible? There already is code to ignore EPIPE, but this specific case doesn't appear to execute in its try block.
Attachments (0)
Change History (3)
comment:1 by , 17 years ago
comment:2 by , 17 years ago
So… why not just put
try: foo except socket.error, e: if e[0] != errno.EPIPE: raise
around any of the calls in _fcgi.py in the backtrace I gave above? The FCGI spec says you should at the very least ignore EPIPE, and code like this is already found in at least one other place in _fcgi.py. You don't need to know the why or how of the error… you always ignore EPIPE.
comment:3 by , 16 years ago
Resolution: | → duplicate |
---|---|
Status: | new → closed |
Found it. It is a duplicate of #3868. Closing, and I'll add a note on that ticket about the suggested patch as well.
I seem to remember discussing the case for other frontends when I got it fixed for mod_python in ticket 3819. With mod_python, we use the mod_python
send_file()
method directly, and are able to catch errors on execution. With other frontends such as FCGI and mod_wsgi Trac only sends away the file and leave it to frontend to handle - and won't really know the why or how for any errors that may occur.Leaving it open for now in case others have more knowledge about it, but I suspect this is a 'cantfix' situation from the Trac side.