You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by Dmitry Konishchev <ko...@gmail.com> on 2010/12/01 13:18:41 UTC

[python-qpid] Blocking on dead sockets

Hi! I use python-qpid and I have faced with a few bugs in it:

* If you open a few connections, and one of them breaks (for example,
  due to a network error), another connections can be locked for time, which is
  equal to network timeout of the broken connection. This happens due to
  working with sockets in blocking mode and due to using one Selector for all
  connections.
* All connections could become locked forever due to races between
  Driver and Selector objects. Driver object removes itself from the Selector
  non-atomically and a situation when Driver is alredy closed, but the Selector
  refers to it could happen. In this case select() call in the Selector raise
  an exeption due to self._transport.fileno() call on Driver where
  self._transport is None. The selector doesn't handle errors on select(), so
  the selector's thread will be stopped due to unhandled Exception.
* There is no checks on EINTR error on os.* calls.

As a temporary solution for me, I've written a patch, which fixes the errors:
https://github.com/KonishchevDmitry/qpid/commit/9090f7f32f5746d00de6fc378ac4b2f4fa75b856

It would be good if you'd include this patch to a new version of Qpid.

-- 
Dmitry Konishchev
mailto:konishchev@gmail.com

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: [python-qpid] Blocking on dead sockets

Posted by Rafael Schloming <ra...@redhat.com>.
On 12/03/2010 01:34 PM, Andrew Stitcher wrote:
> On Wed, 2010-12-01 at 15:18 +0300, Dmitry Konishchev wrote:
>> Hi! I use python-qpid and I have faced with a few bugs in it:
>>
>> * If you open a few connections, and one of them breaks (for example,
>>    due to a network error), another connections can be locked for time, which is
>>    equal to network timeout of the broken connection. This happens due to
>>    working with sockets in blocking mode and due to using one Selector for all
>>    connections.
>> * All connections could become locked forever due to races between
>>    Driver and Selector objects. Driver object removes itself from the Selector
>>    non-atomically and a situation when Driver is alredy closed, but the Selector
>>    refers to it could happen. In this case select() call in the Selector raise
>>    an exeption due to self._transport.fileno() call on Driver where
>>    self._transport is None. The selector doesn't handle errors on select(), so
>>    the selector's thread will be stopped due to unhandled Exception.
>> * There is no checks on EINTR error on os.* calls.
>>
>> As a temporary solution for me, I've written a patch, which fixes the errors:
>> https://github.com/KonishchevDmitry/qpid/commit/9090f7f32f5746d00de6fc378ac4b2f4fa75b856
>>
>> It would be good if you'd include this patch to a new version of Qpid.
>
> IANAL but I believe that before we could accept this patch into qpid
> either:
>
> * You need to sign a contributors agreement
>
> OR (much easier)
>
> * You open a ticket with our Jira bug tracker
> https://issues.apache.org/jira and attach the patch there ticking the
> "Grant License to ASF ..." box.
>
> Sorry to make this more complicated than it might seem it should be.

Good point. I forgot about the legal red tape.

--Rafael

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: [python-qpid] Blocking on dead sockets

Posted by Dmitry Konishchev <ko...@gmail.com>.

Andrew Stitcher wrote:
> * You open a ticket with our Jira bug tracker
> https://issues.apache.org/jira and attach the patch there ticking the
> "Grant License to ASF ..." box.
Done - https://issues.apache.org/jira/browse/QPID-2968

-- 
View this message in context: http://apache-qpid-developers.2158895.n2.nabble.com/python-qpid-Blocking-on-dead-sockets-tp5791649p5801641.html
Sent from the Apache Qpid developers mailing list archive at Nabble.com.

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: [python-qpid] Blocking on dead sockets

Posted by Andrew Stitcher <as...@redhat.com>.
On Wed, 2010-12-01 at 15:18 +0300, Dmitry Konishchev wrote:
> Hi! I use python-qpid and I have faced with a few bugs in it:
> 
> * If you open a few connections, and one of them breaks (for example,
>   due to a network error), another connections can be locked for time, which is
>   equal to network timeout of the broken connection. This happens due to
>   working with sockets in blocking mode and due to using one Selector for all
>   connections.
> * All connections could become locked forever due to races between
>   Driver and Selector objects. Driver object removes itself from the Selector
>   non-atomically and a situation when Driver is alredy closed, but the Selector
>   refers to it could happen. In this case select() call in the Selector raise
>   an exeption due to self._transport.fileno() call on Driver where
>   self._transport is None. The selector doesn't handle errors on select(), so
>   the selector's thread will be stopped due to unhandled Exception.
> * There is no checks on EINTR error on os.* calls.
> 
> As a temporary solution for me, I've written a patch, which fixes the errors:
> https://github.com/KonishchevDmitry/qpid/commit/9090f7f32f5746d00de6fc378ac4b2f4fa75b856
> 
> It would be good if you'd include this patch to a new version of Qpid.

IANAL but I believe that before we could accept this patch into qpid
either:

* You need to sign a contributors agreement

OR (much easier)

* You open a ticket with our Jira bug tracker
https://issues.apache.org/jira and attach the patch there ticking the
"Grant License to ASF ..." box.

Sorry to make this more complicated than it might seem it should be.

Andrew




---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: [python-qpid] Blocking on dead sockets

Posted by Rafael Schloming <ra...@redhat.com>.
On 12/01/2010 07:18 AM, Dmitry Konishchev wrote:
> Hi! I use python-qpid and I have faced with a few bugs in it:
>
> * If you open a few connections, and one of them breaks (for example,
>    due to a network error), another connections can be locked for time, which is
>    equal to network timeout of the broken connection. This happens due to
>    working with sockets in blocking mode and due to using one Selector for all
>    connections.
> * All connections could become locked forever due to races between
>    Driver and Selector objects. Driver object removes itself from the Selector
>    non-atomically and a situation when Driver is alredy closed, but the Selector
>    refers to it could happen. In this case select() call in the Selector raise
>    an exeption due to self._transport.fileno() call on Driver where
>    self._transport is None. The selector doesn't handle errors on select(), so
>    the selector's thread will be stopped due to unhandled Exception.
> * There is no checks on EINTR error on os.* calls.
>
> As a temporary solution for me, I've written a patch, which fixes the errors:
> https://github.com/KonishchevDmitry/qpid/commit/9090f7f32f5746d00de6fc378ac4b2f4fa75b856
>
> It would be good if you'd include this patch to a new version of Qpid.
>

Thanks, I'll have a look at this.

--Rafael


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org