You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Mark Gellings (JIRA)" <ji...@apache.org> on 2010/04/09 16:43:08 UTC

[jira] Created: (AMQNET-247) Bug in FutureResponse on how handles timeout

Bug in FutureResponse on how handles timeout
--------------------------------------------

                 Key: AMQNET-247
                 URL: https://issues.apache.org/activemq/browse/AMQNET-247
             Project: ActiveMQ .Net
          Issue Type: Bug
          Components: NMS
    Affects Versions: 1.2.0
            Reporter: Mark Gellings
            Assignee: Jim Gomes


In FutureReponse.cs, in the Response getter if !latch.awaite(maxWait) times out a timeout exception should be thrown.  Currently there is just a TODO comment.  

This is a bug because when it is not thrown the producer thinks the message was sent successfully when actually it wasn't.  This could be problematic to any system if a message really isn't sent.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


ugg sandals

Posted by generationsuggs <ge...@sina.com>.
http://www.uggsandals.org/ UGG Sandals    
http://www.uggsandals.org/ UGGS For Cheap 
http://www.uggsandals.org/ Kids UGGS 
http://www.uggsandals.org/ UGGS Kids 
http://www.uggsandals.org/ Baby UGGS 
http://www.uggsandals.org/ UGG Kids 
http://www.uggsandals.org/ Black UGGS 

-- 
View this message in context: http://old.nabble.com/-jira--Created%3A-%28AMQNET-247%29-Bug-in-FutureResponse-on-how-handles-timeout-tp28193119p29403823.html
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.


[jira] Commented: (AMQNET-247) Bug in FutureResponse on how handles timeout

Posted by "Timothy Bish (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQNET-247?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=61144#action_61144 ] 

Timothy Bish commented on AMQNET-247:
-------------------------------------

Producer Window Size fixes are going into trunk today, so you should be able to make use of that as well.

> Bug in FutureResponse on how handles timeout
> --------------------------------------------
>
>                 Key: AMQNET-247
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-247
>             Project: ActiveMQ .Net
>          Issue Type: Bug
>          Components: NMS
>    Affects Versions: 1.2.0
>            Reporter: Mark Gellings
>            Assignee: Jim Gomes
>
> In FutureReponse.cs, in the Response getter if !latch.awaite(maxWait) times out a timeout exception should be thrown.  Currently there is just a TODO comment.  
> This is a bug because when it is not thrown the producer thinks the message was sent successfully when actually it wasn't.  This could be problematic to any system if a message really isn't sent.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQNET-247) Bug in FutureResponse on how handles timeout

Posted by "Mark Gellings (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQNET-247?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=59099#action_59099 ] 

Mark Gellings commented on AMQNET-247:
--------------------------------------

In my opinion I think the implementation should be the same as the java implementation, so no Exception.  Although I know the implementations between NMS and the java client will drift a bit as needed due to the language semantics.

I would focus our effort on the producer window size since that seems to be the true fix for this.

> Bug in FutureResponse on how handles timeout
> --------------------------------------------
>
>                 Key: AMQNET-247
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-247
>             Project: ActiveMQ .Net
>          Issue Type: Bug
>          Components: NMS
>    Affects Versions: 1.2.0
>            Reporter: Mark Gellings
>            Assignee: Jim Gomes
>
> In FutureReponse.cs, in the Response getter if !latch.awaite(maxWait) times out a timeout exception should be thrown.  Currently there is just a TODO comment.  
> This is a bug because when it is not thrown the producer thinks the message was sent successfully when actually it wasn't.  This could be problematic to any system if a message really isn't sent.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQNET-247) Bug in FutureResponse on how handles timeout

Posted by "Timothy Bish (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQNET-247?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=58732#action_58732 ] 

Timothy Bish commented on AMQNET-247:
-------------------------------------

Feel free to attach a patch and corresponding unit test.

> Bug in FutureResponse on how handles timeout
> --------------------------------------------
>
>                 Key: AMQNET-247
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-247
>             Project: ActiveMQ .Net
>          Issue Type: Bug
>          Components: NMS
>    Affects Versions: 1.2.0
>            Reporter: Mark Gellings
>            Assignee: Jim Gomes
>
> In FutureReponse.cs, in the Response getter if !latch.awaite(maxWait) times out a timeout exception should be thrown.  Currently there is just a TODO comment.  
> This is a bug because when it is not thrown the producer thinks the message was sent successfully when actually it wasn't.  This could be problematic to any system if a message really isn't sent.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (AMQNET-247) Bug in FutureResponse on how handles timeout

Posted by "Jim Gomes (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQNET-247?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jim Gomes resolved AMQNET-247.
------------------------------

    Resolution: Won't Fix

> Bug in FutureResponse on how handles timeout
> --------------------------------------------
>
>                 Key: AMQNET-247
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-247
>             Project: ActiveMQ .Net
>          Issue Type: Bug
>          Components: NMS
>    Affects Versions: 1.2.0
>            Reporter: Mark Gellings
>            Assignee: Jim Gomes
>
> In FutureReponse.cs, in the Response getter if !latch.awaite(maxWait) times out a timeout exception should be thrown.  Currently there is just a TODO comment.  
> This is a bug because when it is not thrown the producer thinks the message was sent successfully when actually it wasn't.  This could be problematic to any system if a message really isn't sent.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQNET-247) Bug in FutureResponse on how handles timeout

Posted by "Mark Gellings (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQNET-247?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=59100#action_59100 ] 

Mark Gellings commented on AMQNET-247:
--------------------------------------

To add.  We ended up disabling producer flow control on broker topics and increasing the system usage memory on the broker.  During stress testing of Queues we didn't run into this problem so we left flow control on for queues.

> Bug in FutureResponse on how handles timeout
> --------------------------------------------
>
>                 Key: AMQNET-247
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-247
>             Project: ActiveMQ .Net
>          Issue Type: Bug
>          Components: NMS
>    Affects Versions: 1.2.0
>            Reporter: Mark Gellings
>            Assignee: Jim Gomes
>
> In FutureReponse.cs, in the Response getter if !latch.awaite(maxWait) times out a timeout exception should be thrown.  Currently there is just a TODO comment.  
> This is a bug because when it is not thrown the producer thinks the message was sent successfully when actually it wasn't.  This could be problematic to any system if a message really isn't sent.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQNET-247) Bug in FutureResponse on how handles timeout

Posted by "Timothy Bish (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQNET-247?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=59092#action_59092 ] 

Timothy Bish commented on AMQNET-247:
-------------------------------------

The behaviour is consistent with the Java client's implementation.  It might make more sense to throw an exception in this case since this setting really indicates that some boundary condition you configured was exceeded.  When the send timeout occurs you are not sure whether the message was indeed sent so an exception might be more appropriate, since while it is possible for the message to eventually get acked by the broker its also possible the connection could get broken or the broker could go down, who knows.  

The producer window size stuff isn't completely implemented in NMS yet as far as I know, its a bit tricky because of the issue with matching the reported message size on the client with that of the broker, there's usually a small difference if I remember correctly, so it needs some more work.  

> Bug in FutureResponse on how handles timeout
> --------------------------------------------
>
>                 Key: AMQNET-247
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-247
>             Project: ActiveMQ .Net
>          Issue Type: Bug
>          Components: NMS
>    Affects Versions: 1.2.0
>            Reporter: Mark Gellings
>            Assignee: Jim Gomes
>
> In FutureReponse.cs, in the Response getter if !latch.awaite(maxWait) times out a timeout exception should be thrown.  Currently there is just a TODO comment.  
> This is a bug because when it is not thrown the producer thinks the message was sent successfully when actually it wasn't.  This could be problematic to any system if a message really isn't sent.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQNET-247) Bug in FutureResponse on how handles timeout

Posted by "Mark Gellings (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQNET-247?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=58731#action_58731 ] 

Mark Gellings commented on AMQNET-247:
--------------------------------------

I also believe the catch block should rethrow the exception as follows:

try
{

	if(!latch.await(maxWait))
	{
		// TODO: Throw timeout exception?
	}
}
catch (Exception e)
{
	Tracer.Error("Caught while waiting on monitor: " + e);
        throw;
}

> Bug in FutureResponse on how handles timeout
> --------------------------------------------
>
>                 Key: AMQNET-247
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-247
>             Project: ActiveMQ .Net
>          Issue Type: Bug
>          Components: NMS
>    Affects Versions: 1.2.0
>            Reporter: Mark Gellings
>            Assignee: Jim Gomes
>
> In FutureReponse.cs, in the Response getter if !latch.awaite(maxWait) times out a timeout exception should be thrown.  Currently there is just a TODO comment.  
> This is a bug because when it is not thrown the producer thinks the message was sent successfully when actually it wasn't.  This could be problematic to any system if a message really isn't sent.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQNET-247) Bug in FutureResponse on how handles timeout

Posted by "Mark Gellings (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQNET-247?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=58734#action_58734 ] 

Mark Gellings commented on AMQNET-247:
--------------------------------------

I've actually looked into this a bit more and think I understand why just the TODO comment was left with a ? mark.  If the broker activated flow control (provided default window size is not active on the client), then we can't assume the message didn't get to the broker.  The ResponseCorrelator actually operates on a seperate thread and is listening for an acknowledgement that the broker received the message.

So bottom line, if we timed out and indicated the message didn't reach the broker then that also may be misleading, because eventually the response may come back and the message may have been delivered.  

In our scenario it seems when the broker activates flow control, a deadlock occurs.  At that point our system under test freezes up.  Apparently a deadlock is possible if going by the ActiveMQ in Action book, which is what we assume is occurring (book excerpt below).

So I think it comes down to two possible solutions:

1) Activate producer flow control the preferrably way (through the producer window size setting on the producer end).  Theoretically though if one had enough producers the broker could still activate flow control and the suspected deadlock could occur.
2) Disable flow control altogether.  We are using jdbc master/slave so we aren't too concerned about processing speed anyway.  If messages don't get stored in memory it isn't a real big deal.

Do you have any thoughts on this Tim?  Does this all make sense to you? 

Example 13.10. Setting the producer window size
ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory();
cf.setProducerWindowSize(1024000);

The producerWindowSize is the number bytes allowed in the producers send
buffer before it will be forced to wait for a receipt from the broker that it is still
within its limits.
If this isn't enabled for an asynchronous publisher, the broker will still pause
message flow, defaulting to simply blocking the message producers transport
(*which is inefficient and prone to deadlocks*).

> Bug in FutureResponse on how handles timeout
> --------------------------------------------
>
>                 Key: AMQNET-247
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-247
>             Project: ActiveMQ .Net
>          Issue Type: Bug
>          Components: NMS
>    Affects Versions: 1.2.0
>            Reporter: Mark Gellings
>            Assignee: Jim Gomes
>
> In FutureReponse.cs, in the Response getter if !latch.awaite(maxWait) times out a timeout exception should be thrown.  Currently there is just a TODO comment.  
> This is a bug because when it is not thrown the producer thinks the message was sent successfully when actually it wasn't.  This could be problematic to any system if a message really isn't sent.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.