[Zope] Zope pretends to receive and send XMLRPC data,
but strace sees nothing !
yacine chaouche
yacinechaouche at gmail.com
Thu Jan 18 10:31:56 EST 2007
Hi,
I have an ajax application that is composed by :
1) An ajax client which is a web page with a button that calls a zope
object's method, say "toutCompter".
2) An ajax server (zope), with a zope object that has the method
"toutCompter" (all zope object methods are XMLRPC callable right ?).
I use two browsers on two separate machines. I call the methode on the two
browsers, and compares the zope trace and strace output of the network
activity. The problem is that zope says he sends data but strace don't, and
zope says he receives data and again strace don't.
This is the zope/python code that prints to the console :
<zope/python>
def toutCompter(self):
"""
this method is called via XMLRPC.
"""
IPAdresse = self.REQUEST["REMOTE_ADDR"]
print "ip:",IPAdresse,"requests counting of lines",self.getForm
('min'),"to",self.getForm('max')
... #some processing here. creation of XMLData
print "sending results to "+IPAdresse
return XMLData
</zope/python>
Zope says :
<zope traces to the console>
ip: 10.75.49.155 requests counting of lines 10 to 20
ip: 10.75.49.51 requests counting of lines 10 to 20
sending results to 10.75.49.155
sending results to 10.75.49.51
ip: 10.75.49.51 requests counting of lines 10 to 20
sending results to 10.75.49.51
</zope trace>
while strace says (SIGRTMIN were stripped out, are they of any use here ?):
<strace>
recv(24, 0x8d1e7e4, 4096, 0) = -1 ECONNRESET (Connection reset by
peer)
recv(24, "POST /aef/rechercheMultiligne/to"..., 4096, 0) = 686
recv(28, "POST /aef/rechercheMultiligne/to"..., 4096, 0) = 649
recv(28, "requete_11=%2410%20and%20ptel%20"..., 4096, 0) = 445
send(24, "HTTP/1.1 200 OK\r\nServer: Zope/(Z"..., 666, 0) = 666
recv(24, 0x8ebac04, 4096, 0) = -1 ECONNRESET (Connection reset by
peer)
send(28, "HTTP/1.1 200 OK\r\nServer: Zope/(Z"..., 643, 0) = 643
</strace>
As you can see, the first part of the zope trace:
ip: 10.75.49.155 requests counting of lines 10 to 20
ip: 10.75.49.51 requests counting of lines 10 to 20
corresponds to this part of the strace :
recv(24, 0x8d1e7e4, 4096, 0) = -1 ECONNRESET (Connection reset by
peer)
recv(24, "POST /aef/rechercheMultiligne/to"..., 4096, 0) = 686
<comment> WHERE IS POST DATA FOR SOCKET 24??? </comment>
recv(28, "POST /aef/rechercheMultiligne/to"..., 4096, 0) = 649
recv(28, "requete_11=%2410%20and%20ptel%20"..., 4096, 0) = 445
This part is ok. XMLHTTPRequest data is sent, saying :"hello ! i request the
toutCompter methode. This is the post-data that you need to process my
query. Thanks folk, seeya !".
Now the second part is wierd, because the zope trace and strace DO NOT MATCH
:
<zope trace part II, sending data back to XMLHTTPRequest>
sending results to 10.75.49.155
sending results to 10.75.49.51
ip: 10.75.49.51 requests counting of lines 10 to 20
sending results to 10.75.49.51
</zope trace>
<strace part II, data sent only to one machine !>
send(24, "HTTP/1.1 200 OK\r\nServer: Zope/(Z"..., 666, 0) = 666
recv(24, 0x8ebac04, 4096, 0) = -1 ECONNRESET (Connection reset by
peer)
send(28, "HTTP/1.1 200 OK\r\nServer: Zope/(Z"..., 643, 0) = 643
</strace>
let's match line by line :
=====================================================================================
zope strace
=====================================================================================
sending results to 10.75.49.155 => send(24, "HTTP/1.1
200 OK\r\nServer: Zope/(Z"..., 666, 0) = 666
sending results to 10.75.49.51 => you are such a liar !
no data was really sent !
ip: 10.75.49.51 requests counting of lines 10 to 20 => WHAT ? there's no
recv at all !! except for the reset !
sending results to 10.75.49.51 => send(28, "HTTP/1.1 200
OK\r\nServer: Zope/(Z"..., 643, 0) = 643
=====================================================================================
This behaviour is repeated every time i use two browsers, be it on the same
machine or on two separate machines.
It all seems like zope would save the xmlrpc requests in a buffer and
process on of the requests many times (sometimes more than twice !), or
something alike.
I would like to notice here that I use Zope 2.9.0 in single thread mode and
python 2.4.2
I would really appreciate anybody's comment on this strange brehaviour.
Thank you.
Y.Chaouche
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope/attachments/20070118/6be980a2/attachment.htm
More information about the Zope
mailing list