You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Eddie Fast (JIRA)" <ji...@apache.org> on 2011/08/05 00:43:27 UTC

[jira] [Created] (AMQNET-338) TcpTransport.cs - Close() taking 30 seconds

TcpTransport.cs - Close() taking 30 seconds
-------------------------------------------

                 Key: AMQNET-338
                 URL: https://issues.apache.org/jira/browse/AMQNET-338
             Project: ActiveMQ .Net
          Issue Type: Bug
          Components: NMS
    Affects Versions: 1.5.1
         Environment: Windows 7, .NET 2.0, Visual Studio 2008, Unity 3.4
            Reporter: Eddie Fast
            Assignee: Jim Gomes


We've been noticing a random freeze on exit for 30 seconds.  The frequency is different per machine, but it happens about 10-30% of the time, sometimes more.  We've traced it down to TcpTransport.Close(), in this block:

{noformat}
if(null != readThread)
{
	if(Thread.CurrentThread != readThread && readThread.IsAlive)
	{
		if(!readThread.Join((int) MAX_THREAD_WAIT.TotalMilliseconds))
		{
			readThread.Abort();
		}
	}

	readThread = null;
}
{noformat}


We're running this in the Unity game engine, which run C# script in a Mono environment.

I understand that reproducing this on your end would be difficult, but I'm reporting this in the hopes that I can gain some insight why this is happening.

- What thread is this code waiting for?
- What would be some of the causes of the deadlock?

No messages are being sent or received.  It's basically starting up and closing down.

Our temporary workaround is to reduce this wait time from 30 seconds to 5 seconds, but I'd like to eventually find a cause.

Thanks

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (AMQNET-338) TcpTransport.cs - Close() taking 30 seconds

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

Timothy Bish commented on AMQNET-338:
-------------------------------------

Have you tried the same code under the MS .NET library.  I've noticed that Mono threading and collections can sometimes cause some real slowdowns.  

The TcpTransport is waiting for its internal socket reader thread to shutdown, that thread reads and unmarshals the messages from the broker.

> TcpTransport.cs - Close() taking 30 seconds
> -------------------------------------------
>
>                 Key: AMQNET-338
>                 URL: https://issues.apache.org/jira/browse/AMQNET-338
>             Project: ActiveMQ .Net
>          Issue Type: Bug
>          Components: NMS
>    Affects Versions: 1.5.1
>         Environment: Windows 7, .NET 2.0, Visual Studio 2008, Unity 3.4
>            Reporter: Eddie Fast
>            Assignee: Jim Gomes
>
> We've been noticing a random freeze on exit for 30 seconds.  The frequency is different per machine, but it happens about 10-30% of the time, sometimes more.  We've traced it down to TcpTransport.Close(), in this block:
> {noformat}
> if(null != readThread)
> {
> 	if(Thread.CurrentThread != readThread && readThread.IsAlive)
> 	{
> 		if(!readThread.Join((int) MAX_THREAD_WAIT.TotalMilliseconds))
> 		{
> 			readThread.Abort();
> 		}
> 	}
> 	readThread = null;
> }
> {noformat}
> We're running this in the Unity game engine, which run C# script in a Mono environment.
> I understand that reproducing this on your end would be difficult, but I'm reporting this in the hopes that I can gain some insight why this is happening.
> - What thread is this code waiting for?
> - What would be some of the causes of the deadlock?
> No messages are being sent or received.  It's basically starting up and closing down.
> Our temporary workaround is to reduce this wait time from 30 seconds to 5 seconds, but I'd like to eventually find a cause.
> Thanks

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (AMQNET-338) TcpTransport.cs - Close() taking 30 seconds

Posted by "Eddie Fast (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQNET-338?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13080102#comment-13080102 ] 

Eddie Fast commented on AMQNET-338:
-----------------------------------

We've been running the same C# library in our regular MS .NET desktop apps for years without problems, so I suspect that you are right that it might be Mono specific.


> TcpTransport.cs - Close() taking 30 seconds
> -------------------------------------------
>
>                 Key: AMQNET-338
>                 URL: https://issues.apache.org/jira/browse/AMQNET-338
>             Project: ActiveMQ .Net
>          Issue Type: Bug
>          Components: NMS
>    Affects Versions: 1.5.1
>         Environment: Windows 7, .NET 2.0, Visual Studio 2008, Unity 3.4
>            Reporter: Eddie Fast
>            Assignee: Jim Gomes
>
> We've been noticing a random freeze on exit for 30 seconds.  The frequency is different per machine, but it happens about 10-30% of the time, sometimes more.  We've traced it down to TcpTransport.Close(), in this block:
> {noformat}
> if(null != readThread)
> {
> 	if(Thread.CurrentThread != readThread && readThread.IsAlive)
> 	{
> 		if(!readThread.Join((int) MAX_THREAD_WAIT.TotalMilliseconds))
> 		{
> 			readThread.Abort();
> 		}
> 	}
> 	readThread = null;
> }
> {noformat}
> We're running this in the Unity game engine, which run C# script in a Mono environment.
> I understand that reproducing this on your end would be difficult, but I'm reporting this in the hopes that I can gain some insight why this is happening.
> - What thread is this code waiting for?
> - What would be some of the causes of the deadlock?
> No messages are being sent or received.  It's basically starting up and closing down.
> Our temporary workaround is to reduce this wait time from 30 seconds to 5 seconds, but I'd like to eventually find a cause.
> Thanks

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Closed] (AMQNET-338) TcpTransport.cs - Close() taking 30 seconds

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

Timothy Bish closed AMQNET-338.
-------------------------------

    Resolution: Cannot Reproduce
      Assignee: Timothy Bish  (was: Jim Gomes)

Closing this as it appears to be a Mono only issue and is likely resolved by simply using a later version of Mono.  If this issue reappears please reopen.
                
> TcpTransport.cs - Close() taking 30 seconds
> -------------------------------------------
>
>                 Key: AMQNET-338
>                 URL: https://issues.apache.org/jira/browse/AMQNET-338
>             Project: ActiveMQ .Net
>          Issue Type: Bug
>          Components: NMS
>    Affects Versions: 1.5.1
>         Environment: Windows 7, .NET 2.0, Visual Studio 2008, Unity 3.4
>            Reporter: Eddie Fast
>            Assignee: Timothy Bish
>
> We've been noticing a random freeze on exit for 30 seconds.  The frequency is different per machine, but it happens about 10-30% of the time, sometimes more.  We've traced it down to TcpTransport.Close(), in this block:
> {noformat}
> if(null != readThread)
> {
> 	if(Thread.CurrentThread != readThread && readThread.IsAlive)
> 	{
> 		if(!readThread.Join((int) MAX_THREAD_WAIT.TotalMilliseconds))
> 		{
> 			readThread.Abort();
> 		}
> 	}
> 	readThread = null;
> }
> {noformat}
> We're running this in the Unity game engine, which run C# script in a Mono environment.
> I understand that reproducing this on your end would be difficult, but I'm reporting this in the hopes that I can gain some insight why this is happening.
> - What thread is this code waiting for?
> - What would be some of the causes of the deadlock?
> No messages are being sent or received.  It's basically starting up and closing down.
> Our temporary workaround is to reduce this wait time from 30 seconds to 5 seconds, but I'd like to eventually find a cause.
> Thanks

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira