Edgewall Software
Modify

Opened 5 years ago

Closed 5 years ago

#11551 closed defect (fixed)

upgrade to os x 10.9 seems to introduce tracd errors

Reported by: Bill Hernandez (Plano, Texas) Owned by: Jun Omae
Priority: normal Milestone: 0.12.6
Component: general Version: 1.0.1
Severity: normal Keywords: http11 exception tracd
Cc:
Release Notes:

Avoid "Broken pipe" from tracd if the client disconnects on Python 2.6 and later.

API Changes:

Description (last modified by Jun Omae)

I have installed OS X 10.9 Mavericks on several machines, and after reboot I notice errors that I have not seen with prior versions of the operating system.

$ tracd --version
tracd 1.0.1

Any ideas ?

Bill Hernandez Plano, Texas

$ export TRAC_ENV_INDEX_TEMPLATE=/source/templates/projects.html
$ trac_env=/source/trac; /usr/local/bin/tracd --port=8000 -e ${trac_env} --basic-auth=*,${trac_env}/.htpasswd,${trac_env}
Server starting in PID 472.
Serving on 0.0.0.0:8000 view at http://127.0.0.1:8000/
Using HTTP/1.1 protocol version
127.0.0.1 - - [18/Mar/2014 22:02:31] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [18/Mar/2014 22:02:31] "GET / HTTP/1.1" 200 -
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 49279)
Traceback (most recent call last):
 File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 593, in process_request_thread
    self.finish_request(request, client_address)
 File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 334, in finish_request
    self.RequestHandlerClass(request, client_address, self)
 File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 651, in __init__
    self.finish()
 File "build/bdist.macosx-10.8-intel/egg/trac/web/wsgi.py", line 196, in finish
    BaseHTTPRequestHandler.finish(self)
 File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 710, in finish
    self.wfile.close()
 File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 279, in close
    self.flush()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 303, in flush
    self._sock.sendall(view[write_offset:write_offset+buffer_size])
error: [Errno 32] Broken pipe
----------------------------------------
NOTICE THE LINE CONTAINING: File "build/bdist.macosx-10.8-intel/egg/trac/web/wsgi.py", line 196, in finish

I was not able to find any info on how to remove "build/bdist.macosx-10.8-intel" and install "build/bdist.macosx-10.9-intel"

I am not a python person, so I would be most grateful for some detailed info…

Attachments (0)

Change History (6)

comment:1 Changed 5 years ago by Bill Hernandez (Plano, Texas)

Description: modified (diff)

comment:2 Changed 5 years ago by Jun Omae

Description: modified (diff)
Priority: highestnormal

comment:3 Changed 5 years ago by Bill Hernandez Plano, Texas

I have an applescript that sets up a number of things, launches the terminal, launches Safari and pulls up my master page.

I changed all the references to Safari with "Google Chrome", restarted the machine and there was no change in the errors.

Hopefully someone will have a fix.

Thank You!

comment:4 Changed 5 years ago by Jun Omae

Keywords: http11 exception tracd added
Milestone: 0.12.6
Owner: set to Jun Omae
Status: newassigned

Reproduced on Python 2.6 and 2.7 on Linux with Firefox and Chrome on Windows. Not reproduced on Python 2.5. When the client disconnects, the issue occurs. #8357 is related.

Try the following patch.

  • trac/web/wsgi.py

    diff --git a/trac/web/wsgi.py b/trac/web/wsgi.py
    index 820144f..ed9216e 100644
    a b class WSGIRequestHandler(BaseHTTPRequestHandler):  
    194194
    195195    def finish(self):
    196196        """We need to help the garbage collector a little."""
    197         BaseHTTPRequestHandler.finish(self)
    198         self.wfile = None
    199         self.rfile = None
     197        try:
     198            BaseHTTPRequestHandler.finish(self)
     199        except (IOError, socket.error), e:
     200            if e.args[0] not in (errno.EPIPE, errno.ECONNRESET, 10053, 10054):
     201                # ignore an exception when the client disconnects
     202                raise
     203        finally:
     204            self.wfile = None
     205            self.rfile = None
    200206
    201207
    202208class WSGIServerGateway(WSGIGateway):

comment:5 Changed 5 years ago by Bill Hernandez (Plano, Texas)

AWESOME, The patch fixed the problem !

I can't believe how fast you guys came up with a solution to my problem !

The very best to all who responded…

comment:6 Changed 5 years ago by Jun Omae

Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Thanks for rapid feedback ;)

Committed in [12600] and merged to 1.0-stable in [12601] and trunk in [12602].

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jun Omae.
The resolution will be deleted.
to The owner will be changed from Jun Omae to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.