Bug 755639 - timeout parameter in sender send() method is ignored if the queue is in PFC active state
Summary: timeout parameter in sender send() method is ignored if the queue is in PFC a...
Keywords:
Status: NEW
Alias: None
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: python-qpid
Version: 2.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: messaging-bugs
QA Contact: MRG Quality Engineering
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-11-21 16:45 UTC by Petr Matousek
Modified: 2021-03-16 12:47 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Target Upstream Version:


Attachments (Terms of Use)
simple test reproducer (703 bytes, application/x-python)
2011-11-21 16:47 UTC, Petr Matousek
no flags Details

Description Petr Matousek 2011-11-21 16:45:32 UTC
Description of problem:

Specified 'timeout' parameter is ignored by send() method of the sender if a queue is PFC active state. Sender is blocked in send() method until several messages are dequeued (PFC deactivated) regardless specified timeout. 

This could probably cause an application hang, i.e. if all consumers dies

This issue is valid on latest packages (0.12-6) as well

Version-Release number of selected component (if applicable):
python-qpid-0.10-1.el5
python-qpid-qmf-0.10-10.el5
qpid-cpp-client-0.10-9.el5
qpid-cpp-client-devel-0.10-9.el5
qpid-cpp-client-devel-docs-0.10-9.el5
qpid-cpp-client-ssl-0.10-9.el5
qpid-cpp-server-0.10-9.el5
qpid-cpp-server-cluster-0.10-9.el5
qpid-cpp-server-devel-0.10-9.el5
qpid-cpp-server-ssl-0.10-9.el5
qpid-cpp-server-store-0.10-9.el5
qpid-cpp-server-xml-0.10-9.el5
qpid-java-client-0.10-9.el5
qpid-java-common-0.10-9.el5
qpid-java-example-0.10-9.el5
qpid-qmf-0.10-10.el5
qpid-qmf-devel-0.10-10.el5
qpid-tools-0.10-6.el5

How reproducible:
100%

Steps to Reproduce:
1. qpidd running with default PFC rules (threshold 80%)
2. run the test reproducer
3. sender is blocked by PFC on sending message number 9
4. the sender is blocked until some messages are consumed even if the timeout was specified for the send() method
  
Actual results:
send() method of the sender will never timeout even if the 'timeout' parameter was defined

Expected results:
send() method of the sender will timeout after defined interval

Additional info:

Comment 1 Petr Matousek 2011-11-21 16:47:55 UTC
Created attachment 534823 [details]
simple test reproducer

Comment 2 Ken Giusti 2011-11-21 22:03:15 UTC
The timeout parameter to send() is ignored by the python client if capacity is set to unlimited (as it is in the reproducer - unlimited is the default).  According to the documentation, this is by design.

HOWEVER, If I change the reproducer to set a capacity value, such as:

  sender = session.sender("q;{create:sender,delete:receiver, node: {x-declare:{arguments:{'qpid.max_count':10}}}}",
                          capacity=1)

The python client is still ignoring the timeout parameter.  In endpoints.py:

    if self.capacity is not UNLIMITED:
      print("CAPACITY=%s" % self.capacity)
      if self.capacity <= 0:
        raise InsufficientCapacity("capacity = %s" % self.capacity)
      print("AVAILABLE=%s" % self.available())
      if not self._ecwait(self.available, timeout=timeout):
        raise InsufficientCapacity("capacity = %s" % self.capacity)

The code that computes self.available() always returns '1', indicating capacity available, and the timeout is not used.

Not sure if this is correct, as the C++ client does not support a "timeout" parameter in its send so I cannot check the behavior.


Note You need to log in before you can comment on or make changes to this bug.