[prev in list] [next in list] [prev in thread] [next in thread]
List: zeromq-dev
Subject: [zeromq-dev] HA: s390x build failure
From: Sergey Hripchenko <shripchenko () intermedia ! net>
Date: 2012-04-25 17:35:37
Message-ID: 12608614.597899.1335375339828.JavaMail.root () emg-ca-1-2 ! securemail ! intermedia ! net
[Download RAW message or body]
[Attachment #2 (text/plain)]
zmq_disconnect() and zmq_unbind() are aliases to eachother ^)
> > Also, for unbind() should this just
> > stop the listening of new connections
already patched
> > but leave existing connections intact?
I believe that the proper behavior is to terminate them with LINGER value(the same as \
in zmq_term()) Unfortunately this is not happen
and here is my description of second bug ^) now for unbind():
PULL->bind() socket doesn't disconnect all connected sessions after zmq_unbind() and \
ZMQ_LINGER expired. (tcp_listener_t and all owned base_session_t(connect=false) \
actually terminated only at zmq_term() althrough tcp_listener_t processes TERM \
command and propagates it to all owned base_session_t, but then the terminate process \
stops(even after LINGER timer event)... I believe it stops somewhere in \
pipe_t::process_term()) Example code:
a. Server: http://pastebin.com/bUvcguCK
b. Client: http://pastebin.com/yPxsbf83
c. Run server, server will block in zmq_send().
d. Run client.
e. Run ‘netstat –anp | grep 5560' to ensure that you have 3 TCP sockets(one \
listening and two for bidirectional connection):
root@ast-pbx-spb-1:~# netstat -anp | grep 5560
tcp 0 0 127.0.0.1:5560 0.0.0.0:* LISTEN \
12913/push
tcp 0 0 127.0.0.1:5560 127.0.0.1:60814 ESTABLISHED \
12913/push
tcp 0 0 127.0.0.1:60814 127.0.0.1:5560 ESTABLISHED \
12934/pull
f. Wait for 10 packets and zmq_unbind() and sleep() forever
g. Run again ‘netstat –anp | grep 5560' to ensure that you still have 2 \
bidirectional TCP sockets, so sessions will not be disconnected. server is blocked \
again in zmq_send() – which is good client will wait forever in dead PUSH \
connection since it never closed.
________________________________
От: zeromq-dev-bounces@lists.zeromq.org [zeromq-dev-bounces@lists.zeromq.org] от \
имени Neale Ferguson [neale@sinenomine.net] Отправлено: 25 \
апреля 2012 г. 21:21
To: ZeroMQ development list
Тема: Re: [zeromq-dev] s390x build failure
<naïve>
When zmq_unbind() completes, can't an indicator be set in the structure representing \
the structure such that subsequent I/O causing APIs will check this and not go \
further down the stack to try and complete the call? Similarly, couldn't \
zmq_disconnect() do the same? Also, for unbind() should this just stop the listening \
of new connections but leave existing connections intact? Judging by the way's it's \
being used I assume the answer is no. </naïve>
On 4/25/12 12:35 PM, "Sergey Hripchenko" \
<shripchenko@intermedia.net<UrlBlockedError.aspx>> wrote:
I was hoping that you have more exotic OS ^)
About issue: zmq_sleep (1) should be _enough_ for everything.
However, for example I found that:
PUSH->connect()
PUSH->recv() > 0
PUSH->disconnect()
// and this will leave PUSH -> session_base_t -> tcp_connecter_t forever until you \
call some io functions like PUSH->recv(ZMQ_DONTWAIT)=-1 // the TERM command simply \
_NOT_ propagaded from session_base_t::process_term_req()(called in application \
thread) to tcp_connecter_t::process_term()(called in ZMQ IO thread)
Not sure if anyone interested in this issue...
________________________________
This message is intended only for the person(s) to which it is addressed and may \
contain Intermedia.net Inc privileged, confidential and/or proprietary information. \
If you have received this communication in error, please notify us immediately by \
replying to the message and deleting it from your computer. Any disclosure, copying, \
distribution, or the taking of any action concerning the contents of this message and \
any attachment(s) by anyone other than the named recipient(s) is strictly prohibited.
[Attachment #3 (text/html)]
<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style id="owaParaStyle" type="text/css">
<!--
p
{margin-top:0;
margin-bottom:0}
-->
</style>
</head>
<body>
<div style="direction:ltr; font-family:Tahoma; color:#000000; font-size:10pt"><font \
face="Calibri, Verdana, Helvetica, Arial"><span \
style="font-size:11pt">zmq_disconnect() and zmq_unbind() are aliases to eachother \
^)<br> <br>
>> Also, for unbind() should this just<br>
>> stop the listening of new connections<br>
already patched<br>
>>but leave existing connections intact?<br>
I believe that the proper behavior is to terminate them with LINGER value(the same as \
in zmq_term())<br> Unfortunately this is not happen<br>
and here is my description of second bug ^) now for unbind():<br>
<br>
<br>
<br>
</span></font>PULL->bind() socket doesn't disconnect all connected sessions<span \
style=""> </span>after <span class="SpellE">zmq_unbind</span>() and ZMQ_LINGER \
expired.<br> (<span class="SpellE">tcp_listener_t</span> and all owned <span \
class="SpellE">base_session_t</span>(connect=false) actually terminated only at <span \
class="SpellE">zmq_term</span>() <span class="SpellE">althrough</span> <span \
class="SpellE"> tcp_listener_t</span> processes TERM command and propagates it to all \
owned <span class="SpellE"> base_session_t</span>, but then the terminate process \
stops(even after LINGER timer event)... I believe it stops somewhere in \
pipe_t::process_term())<br> Example code:
<p class="MsoPlainText" style="margin-left:72.0pt; text-indent:-18.0pt"><span \
style=""><span style="">a.<span style="font:7.0pt "Times New \
Roman""> </span></span></span>Server: <a \
href="http://pastebin.com/bUvcguCK" target="_blank"> \
http://pastebin.com/bUvcguCK</a></p> <p class="MsoPlainText" \
style="margin-left:72.0pt; text-indent:-18.0pt"><span style=""><span style="">b.<span \
style="font:7.0pt "Times New Roman""> \
</span></span></span>Client: <a href="http://pastebin.com/yPxsbf83" target="_blank"> \
http://pastebin.com/yPxsbf83</a></p> <p class="MsoPlainText" \
style="margin-left:72.0pt; text-indent:-18.0pt"><span style=""><span style="">c.<span \
style="font:7.0pt "Times New Roman""> \
</span></span></span>Run server, server will block in <span \
class="SpellE">zmq_send</span>().</p> <p class="MsoPlainText" \
style="margin-left:72.0pt; text-indent:-18.0pt"><span style=""><span style="">d.<span \
style="font:7.0pt "Times New Roman""> \
</span></span></span>Run client.</p> <p class="MsoPlainText" \
style="margin-left:72.0pt; text-indent:-18.0pt"><span style=""><span style="">e.<span \
style="font:7.0pt "Times New Roman""> \
</span></span></span>Run ‘<span class="SpellE">netstat</span> –<span \
class="SpellE">anp</span> | <span class="SpellE">grep</span> 5560' to ensure that you \
have 3 TCP sockets(one listening and two for bidirectional connection):</p> <p \
class="MsoPlainText"> </p> <p class="MsoPlainText">root@ast-pbx-spb-1:~# <span \
class="SpellE">netstat</span> -<span class="SpellE">anp</span> | <span \
class="SpellE">grep</span> 5560</p> <p class="MsoPlainText"><span \
class="SpellE">tcp</span><span style=""> \
</span> 0<span style=""> </span>0 127.0.0.1:5560<span \
style=""> </span>0.0.0.0:*<span \
style="">
</span>LISTEN<span style=""> </span>12913/push</p>
<p class="MsoPlainText"><span class="SpellE">tcp</span><span \
style=""> </span> 0<span \
style=""> </span>0 127.0.0.1:5560<span \
style=""> \
</span>127.0.0.1:60814<span style=""> \
</span>ESTABLISHED 12913/push</p> <p class="MsoPlainText"><span \
class="SpellE">tcp</span><span style=""> \
</span> 0<span style=""> </span>0 127.0.0.1:60814<span \
style=""> </span>127.0.0.1:5560<span \
style=""> </span>ESTABLISHED \
12934/pull</p> <p class="MsoPlainText"> </p>
<p class="MsoPlainText" style="margin-left:72.0pt; text-indent:-18.0pt"><span \
style=""><span style="">f.<span style="font:7.0pt "Times New \
Roman""> </span></span></span>Wait for \
10 packets and <span class="SpellE">zmq_unbind</span>() and sleep() forever<br> </p>
<p class="MsoPlainText" style="margin-left:72.0pt; text-indent:-18.0pt"><span \
style=""><span style="">g.<span style="font:7.0pt "Times New \
Roman""> </span></span></span>Run again \
‘<span class="SpellE">netstat</span> –<span class="SpellE">anp</span> | <span \
class="SpellE">grep</span> 5560' to ensure that you still have 2 bidirectional TCP \
sockets, so sessions will not be disconnected.<br> server is blocked again in <span \
class="SpellE">zmq_send</span>() – which is good<br> client will wait forever in \
dead PUSH connection since it never closed.</p> <br>
<font face="Calibri, Verdana, Helvetica, Arial"><span style="font-size:11pt"><br>
</span></font><br>
<div style="font-family:Times New Roman; color:#000000; font-size:16px">
<hr tabindex="-1">
<div id="divRpF334284" style="direction:ltr"><font color="#000000" face="Tahoma" \
size="2"><b>От:</b> zeromq-dev-bounces@lists.zeromq.org \
[zeromq-dev-bounces@lists.zeromq.org] от имени Neale Ferguson \
[neale@sinenomine.net]<br> <b>Отправлено:</b> 25 апреля 2012 г. \
21:21<br> <b>To:</b> ZeroMQ development list<br>
<b>Тема:</b> Re: [zeromq-dev] s390x build failure<br>
</font><br>
</div>
<div></div>
<div><font face="Calibri, Verdana, Helvetica, Arial"><span \
style="font-size:11pt"><naïve><br> When zmq_unbind() completes, can't an \
indicator be set in the structure representing the structure such that subsequent I/O \
causing APIs will check this and not go further down the stack to try and complete \
the call? Similarly, couldn't zmq_disconnect() do the same? Also, for unbind() \
should this just stop the listening of new connections but leave existing connections \
intact? Judging by the way's it's being used I assume the answer is no.<br> \
</naïve><br> <br>
<br>
On 4/25/12 12:35 PM, "Sergey Hripchenko" <<a href="UrlBlockedError.aspx" \
target="_blank">shripchenko@intermedia.net</a>> wrote:<br> <br>
</span></font>
<blockquote><font size="2"><font face="Tahoma, Verdana, Helvetica, Arial"><span \
style="font-size:10pt">I was hoping that you have more exotic OS ^)<br> <br>
About issue: zmq_sleep (1) should be _enough_ for everything.<br>
However, for example I found that:<br>
PUSH->connect()<br>
PUSH->recv() > 0<br>
PUSH->disconnect()<br>
// and this will leave PUSH -> session_base_t -> tcp_connecter_t forever until \
you call some io functions like PUSH->recv(ZMQ_DONTWAIT)=-1<br> // the TERM \
command simply _NOT_ propagaded from session_base_t::process_term_req()(called in \
application thread) to tcp_connecter_t::process_term()(called in ZMQ IO thread)<br> \
<br> Not sure if anyone interested in this issue...</span></font></font></blockquote>
</div>
</div>
</div>
<br>
<hr>
<font face="Arial" color="Gray" size="1"><br>
This message is intended only for the person(s) to which it is addressed and may \
contain Intermedia.net Inc privileged, confidential and/or proprietary information. \
If you have received this communication in error, please notify us immediately by \
replying to the message and deleting it from your computer. Any disclosure, copying, \
distribution, or the taking of any action concerning the contents of this message and \
any attachment(s) by anyone other than the named recipient(s) is strictly \
prohibited.<br> </font>
</body>
</html>
_______________________________________________
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev
--===============3806520284555316882==--
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic