Il giorno 03/mag/2012, alle ore 15:10, Łukasz Wróblewski ha scritto: > ----- Oryginalna wiadomość ----- >> Od: "Roberto De Ioris" <[email protected]> >> Do: "uWSGI developers and users list" <[email protected]> >> Wysłane: czwartek, 3 maj 2012 14:42:46 >> Temat: Re: [uWSGI] uwsgi IOError >> >> I definetely used the wrong words :) >> As you said, uWSGI knows about client disconnection at the first >> write()/writev(). >> >> In previous versions, apps was not aware of disconnections and failed >> writes were ignored (you get only a series of SIGPIPE) >> > > > How do I prevent this error. > I am interested in print, that such event took place (client has disconnected > before sending him to answer), but something a bit too much: > > > 2012-04-30 22:10:36 - SIGPIPE: writing to a closed pipe/socket/fd (probably > the client disconnected) on request / (ip ::ffff:178....) !!! > 2012-04-30 22:10:36 - writev(): Broken pipe [proto/uwsgi.c line 122] during > GET / (::ffff:178....) > Traceback (most recent call last): > File "./req.py", line 110, in __iter__ > self.__start_response(self.response.status, self.response.get_headers()) > IOError: write error > > > Enough to: > 2012-04-30 22:10:36 - writev(): Broken pipe [proto/uwsgi.c line 122] during > GET / (::ffff:178....) > > Is the "ignore-sigpipe" solve the problem of excessive amounts of information > in the logs ? > Or maybe I need to wrap the start_response in try ? >
This check is in start_response,WSGI write callback and whenever you call yield/return. A --disable-write-exception would be a better choice, allowing the user to select which error to raise. Currently (by default) we have 3 errors reported: SIGPIPE write/writev() syscall error the IOError exception The first 2 can be already disabled. The last one will be in a patch soon. Curently you can increase the "tolerance" using (a hack) with: --write-errors-tolerance 100 that means, raise the exception only after 100 write errors. -- Roberto De Ioris http://unbit.it JID: [email protected] _______________________________________________ uWSGI mailing list [email protected] http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
