Hello all,<br><br>From times to times, apparently randomly, I have the following uncaught exception in the console :<br><br>2007-01-23 10:41:07 ERROR ZServer uncaptured python exception, closing channel <ZServer.HTTPServer.zhttp_channel
connected <a href="http://10.75.49.51:48177">10.75.49.51:48177</a> at 0x44562e6c channel#: 140 requests:> (socket.error:(104, 'Connection reset by peer') [/opt/python2.4.2/lib/python2.4/asynchat.py|initiate_send|219] [/opt/aef/Zope-
2.9.0/lib/python/ZServer/medusa/http_server.py|send|417] [/opt/python2.4.2/lib/python2.4/asyncore.py|send|332])<br><br>In addition, i have edited this file :Zope-2.9.0/lib/python/ZPublisher/HTTPRequest.py as follows :<br>
<code><br> def retry(self):<br> print "retry called in HTTPRequest for the",self.retry_count,"time"<br> self.retry_count=self.retry_count+1<br> self.stdin.seek(0)<br> r=self.__class__(stdin=
self.stdin,<br> environ=self._orig_env,<br> response=self.response.retry()<br> )<br> r.retry_count=self.retry_count<br> return r<br></code>
<br><br>I only added a single print line to see if this method was called. And indeed, it is ! Does anyone knows when (in what circumstances) this method could be called ???<br><br><console trace><br>ip: <a href="http://10.75.49.155">
10.75.49.155</a> requests counting of lines 11 to 21<br>ip: <a href="http://10.75.49.51">10.75.49.51</a> requests counting of lines 11 to 21<br>sending results to <a href="http://10.75.49.155">10.75.49.155</a><br>sending results to
<a href="http://10.75.49.51">10.75.49.51</a><br>retry called in HTTPRequest for the 0 time<br>ip: <a href="http://10.75.49.51">10.75.49.51</a> requests counting of lines 11 to 21<br><br></console trace><br><br>Thanks.
<br><br>Y.Chaouche<br><br><div><span class="gmail_quote">2007/1/19, yacine chaouche <<a href="mailto:yacinechaouche@gmail.com">yacinechaouche@gmail.com</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
It writes and reads objects in the session, maybe the probleme comes from here ? Here's a little sinppet :<br><br> def toutCompter(self):<br> """<br> xmlrpc methode, called from a web borwser.
<br> """<br> documentXML = ComptageXML()<br> #this reads and writes objects in the session<br> dicoLignes = self._fabriquerDicoLignes()<br> #do things with dicoLignes<br> for inumLigneCourante in xrange(borneInf,borneSup) :
<br> snumLigneCourante = str(inumLigneCourante)<br> ligne = dicoLignes[snumLigneCourante]["requete"]<br> #do things here<br> self._ajouterAuDico(snumLigneCourante,ligne,comptage,arbre)
<br><br> if ligne :<br> self._mettreEnSession(resultats)<br> <br> response = self.REQUEST.RESPONSE<br> response.setHeader("Content-Type","text/xml")<br> response.setHeader
("charset","utf-8")<br> chaineXML = documentXML.formatXML()<br> print "sending results to "+addresseIP<br> return chaineXML<br><br> def _fabriquerDicoLignes(self):<br>
formulaire = self.getForm()<br> dicoLignes = self.getSession(self,"dicoLignes") or {}<br> for key in formulaire.keys():<br> #do things...<br> self.setSession("dicoLignes", dicoLignes)
<br> return dicoLignes<br><br> def _fabriquerListeLignes(self):<br> dicoLignes = RacineAbstraite.getSession(self,"dicoLignes") or {}<br> listeNumeros = dicoLignes.keys()<br> listeNumeros.sort
( lambda x,y: cmp(int(x), int(y)) )<br> return [ dicoLignes[str(inumeroLigne)]["requete"] for inumeroLigne in \<br> sorted( [int(snumeroLigne) for snumeroLigne in dicoLignes.keys()] ) ]<br>
<br> def _ajouterAuDico(self,p_snumeroCle,p_ligne,p_comptage,p_arbre):<br> dicoLignes = RacineAbstraite.getSession(self,'dicoLignes') or {}<br> dicoLignes[p_snumeroCle] = {'requete':p_ligne,'comptage':p_comptage,'arbre':p_arbre}
<br> self.setSession('dicoLignes',dicoLignes)<br><br> def _mettreEnSession(self,p_resultats):<br> """<br> Mettre en session les résultats d'un comptage.<br> """
<br> <br> # Initialise de la SESSION<br> dicoResultatRecherche = {<br> 'listeCriteres' : [self._fabriquerListeLignes(), self.getForm('numeroLigne')],<br> 'nombreEntreprises' : p_resultats[0][0],
<br> 'listeComptage' : p_resultats,<br> 'listeEntreprises' : [],<br> }<br> #On conserve la requete et le resultat en session<br> self.setSession('resultatRecherche', p_dicoResultatRecherche.copy())
<br><br><br>When toutCompter is called by browser 1, then he will write and read, say, the dicoLignes object in the session.<br>When toutCompter is called by browser 2 parallely, is it the same dicoLignes object that it tries to access or another one is created ? can there be conflicts somehow ?
<br><br>Y.Chaouche<br><br><div><span class="e" id="q_11039cecbb055862_1"><div><span class="gmail_quote">2007/1/19, yacine chaouche <<a href="mailto:yacinechaouche@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
yacinechaouche@gmail.com</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I mean triple couples of lines of code.<br><br><div><span class="gmail_quote">2007/1/19, yacine chaouche <<a href="mailto:yacinechaouche@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
yacinechaouche@gmail.com</a>>:</span><div><span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
The toutCompter methode does a lot of thing and it would take a triple couples of lines to describe what it does all.<br>Anyway, is there a way for me to detect ConflictErrors ? they don't appear on the console so i guess they are catched.
<br><br>Y.Chaouche<br><br><div><span class="gmail_quote">2007/1/19, Gabriel Genellina <<a href="mailto:gagsl-zope@yahoo.com.ar" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">gagsl-zope@yahoo.com.ar
</a>>:</span><div><span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
At Thursday 18/1/2007 16:30, Andreas Jung wrote:<br><br><br>><zope trace to the console><br>>ip: <a href="http://10.75.49.155" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">10.75.49.155
</a> requests counting of lines 1 to 11<br>>ip: <a href="http://10.75.49.51" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
10.75.49.51</a> requests counting of lines 1 to 11<br>>sending results to <a href="http://10.75.49.155" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">10.75.49.155</a><br>>sending results to
<a href="http://10.75.49.51" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">10.75.49.51</a><br>>ip: <a href="http://10.75.49.51" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
10.75.49.51</a> requests counting of lines 1 to 11<br>>sending results to <a href="http://10.75.49.51" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">10.75.49.51</a><br>></zope trace><br>
><br>><br>>Zope says he got 2 requests form <a href="http://10.75.49.51" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
10.75.49.51</a> and sent it the results 2<br>>times. Ok, let's check the tcpflow then for these supposed connections :<br>>[...]<br>>Allright, there is only ONE POST request. So zope didnt really got two<br>
>requests. Now let's see if it sent the data two times as it presumes :
<br>>[...]<br>>The results were sent just one time, not two.<br>><br>>What is going on here ?<br><br>What does the toutCompter method really does? Does it modify some<br>object state? That might provoke a ConflictError, forcing a
<br>transaction abort and the request to be re-tried (up to three times,<br>silently, then it goes logged).<br><br><br>--<br>Gabriel Genellina<br>Softlab SRL<br><br><br><br><br><br><br>__________________________________________________
<br>Preguntá. Respondé. Descubrí.<br>Todo lo que querías saber, y lo que ni imaginabas,<br>está en Yahoo! Respuestas (Beta).<br>¡Probalo ya!<br><a href="http://www.yahoo.com.ar/respuestas" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://www.yahoo.com.ar/respuestas
</a><br><br>_______________________________________________<br>Zope maillist - <a href="mailto:Zope@zope.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Zope@zope.org</a><br><a href="http://mail.zope.org/mailman/listinfo/zope" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://mail.zope.org/mailman/listinfo/zope
</a><br>** No cross posts or HTML encoding! **<br>(Related lists -<br> <a href="http://mail.zope.org/mailman/listinfo/zope-announce" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://mail.zope.org/mailman/listinfo/zope-announce
</a><br> <a href="http://mail.zope.org/mailman/listinfo/zope-dev" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://mail.zope.org/mailman/listinfo/zope-dev</a> )<br></blockquote></span></div></div><br>
</blockquote></span></div></div><br>
</blockquote></div><br>
</span></div></blockquote></div><br>