JIRA

  • Log In Access more options
    • Online Help
    • GreenHopper Help
    • Agile Answers
    • Use Agile By Default
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What’s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Agile Access more options (Alt+g)
  • Create Issue
  • Mule
  • MULE-447

TCP Timeout Config Problem

  • Agile Board
  • More Actions
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Won't Fix or Usage Issue
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: Transport: TCP / UDP / SSL / Multicast
  • Labels:
    None
  • Similar Issues:
    None

Description

Hello,

We're trying to use MuleClient to send a synchronous request to a tcp endpoint. We initialize mule client with a config file like this;

<connector name="tcpConnector"
className="org.mule.providers.tcp.TcpConnector">
<properties>
<property name="timeout" value="60000" />
<property name="tcpProtocolClassName"
value="org.mule.providers.tcp.protocols.LengthProtocol"
/>
</properties>
</connector>
<model name="client"/>

And the server like this;

<connector name="tcpConnector"
className="org.mule.providers.tcp.TcpConnector">
<properties>
<property name="timeout" value="60000" />
<property name="tcpProtocolClassName"
value="org.mule.providers.tcp.protocols.LengthProtocol"
/>
</properties>
</connector>

<model name="TestServer">
<mule-descriptor name="TestServiceUMO"
implementation="TestReceiver">
<inbound-router>
<endpoint synchronous="true" remoteSync="true"
remoteSyncTimeout="60000"
address="tcp://localhost:9000"
transformers="BytesToString" />
<interceptor className="default" />
</mule-descriptor>
</model>

No matter what we specify for any of the timeout values. The client allways times out after 10 seconds. I have traced through the code and it appears that the 60 second timeout specified on the connector is being set properly. However when TcpMessageDispatcher executes the following

byte[] result = receive(socket,
event.getEndpoint().getRemoteSyncTimeout());
(around Line 115)

The MuleEndpoint.getRemoteSyncTimeout() is always returning 10000.

I've also noticed that useRemoteSync() for TcpMessageDispatcher appears to always be enabled.

Can someone have a look?

Thanks for your help.

Mark

Issue Links

relates to

Bug - A problem which impairs or prevents the functions of the product. MULE-645 MuleClient.send doesn´t respect the specified timeout

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
  • Transitions
  • Commits
  • Source
  • Builds
Hide
Permalink
Ross Mason added a comment - 01/Nov/05 12:12 PM

Hi Mark,

I can see the the problem. Have tried specifying the time out on your client call, i.e.

... client.send("tcp://localhost:1234", "data", null, 60000);

That should work.
Also, the useRemoteSync is always set to true when making 'send' calls from the client, otherwise you wouldn't get a response back from the TcpMessageDispatcher.

Cheers,
Ross

Show
Ross Mason added a comment - 01/Nov/05 12:12 PM Hi Mark, I can see the the problem. Have tried specifying the time out on your client call, i.e. ... client.send("tcp://localhost:1234", "data", null, 60000); That should work. Also, the useRemoteSync is always set to true when making 'send' calls from the client, otherwise you wouldn't get a response back from the TcpMessageDispatcher. Cheers, Ross
Hide
Permalink
Mark Koch added a comment - 02/Nov/05 05:58 PM

Hi Ross,

Thanks for having a look.

I've tried setting the timeout using the method arg to MuleCliend.send(). However, this doesn't have an affect. I don;t believe getRemoteSyncTimeout() ( which is always called ) has any notion of the timeout being passed via the send() call.

Unless I'm out of date, I believe this means that for the current nightly build all TCP endpoints will always have the DEFAULT_TIMEOUT of 10000 ms.

Mark

Show
Mark Koch added a comment - 02/Nov/05 05:58 PM Hi Ross, Thanks for having a look. I've tried setting the timeout using the method arg to MuleCliend.send(). However, this doesn't have an affect. I don;t believe getRemoteSyncTimeout() ( which is always called ) has any notion of the timeout being passed via the send() call. Unless I'm out of date, I believe this means that for the current nightly build all TCP endpoints will always have the DEFAULT_TIMEOUT of 10000 ms. Mark
Hide
Permalink
Mark Koch added a comment - 21/Jan/06 04:07 PM

This has been for a while. There must not be many users using tcp sych. I've hacked a solution to 1.1 but would like to move to 1.2/1.3. Can you take another look at this issue?

Show
Mark Koch added a comment - 21/Jan/06 04:07 PM This has been for a while. There must not be many users using tcp sych. I've hacked a solution to 1.1 but would like to move to 1.2/1.3. Can you take another look at this issue?
Hide
Permalink
Mark Koch added a comment - 21/Feb/06 07:07 PM

Hi Ross,

Hi Ross,

I'm finally up and running on 1.3-SNAPSHOT. The TCP timeout fix you made appears to be functional, server returns expected results. However, I'm seeing a strange exception in the log. About 60 seconds after any synchronous TCP request is processed, I see the following in the server log;

21 Feb 2006 16:56:25,408 ERROR org.mule.impl.DefaultExceptionStrategy 233 - Caught exception in Exception Strategy: Read timed out
java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:183)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:222)
at java.io.BufferedInputStream.read(BufferedInputStream.java:277)
at java.io.DataInputStream.read(DataInputStream.java:224)
at java.io.DataInputStream.read(DataInputStream.java:170)
at org.mule.providers.tcp.protocols.LengthProtocol.read(LengthProtocol.java:49)
at org.mule.providers.tcp.TcpMessageReceiver$TcpWorker.run(TcpMessageReceiver.java:230)
at org.mule.impl.work.WorkerContext.run(WorkerContext.java:290)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:643)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:668)
at java.lang.Thread.run(Thread.java:534)

As you can see from the stack, I'm using the Length protocol. Here's my basic UMO config;

<mule-descriptor name="ConfigServiceUMO" implementation="configController">
<inbound-router>
<endpoint synchronous="true" address="${ew.esb.service.config.queue.tcp}" transformers="BytesToString XmlToObject" responseTransformers="ObjectToXml"></endpoint>
</inbound-router>
<interceptor className="default" />
</mule-descriptor>

I've played around with setting the remoteSync params ( I admit, I have no idea what they're for ) but this appears to have no effect. Is there something I'm missing that would cause the server to continue reading from the TCP socket?

Thanks,
Mark

Show
Mark Koch added a comment - 21/Feb/06 07:07 PM Hi Ross, Hi Ross, I'm finally up and running on 1.3-SNAPSHOT. The TCP timeout fix you made appears to be functional, server returns expected results. However, I'm seeing a strange exception in the log. About 60 seconds after any synchronous TCP request is processed, I see the following in the server log; 21 Feb 2006 16:56:25,408 ERROR org.mule.impl.DefaultExceptionStrategy 233 - Caught exception in Exception Strategy: Read timed out java.net.SocketTimeoutException: Read timed out at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.read(SocketInputStream.java:129) at java.io.BufferedInputStream.fill(BufferedInputStream.java:183) at java.io.BufferedInputStream.read1(BufferedInputStream.java:222) at java.io.BufferedInputStream.read(BufferedInputStream.java:277) at java.io.DataInputStream.read(DataInputStream.java:224) at java.io.DataInputStream.read(DataInputStream.java:170) at org.mule.providers.tcp.protocols.LengthProtocol.read(LengthProtocol.java:49) at org.mule.providers.tcp.TcpMessageReceiver$TcpWorker.run(TcpMessageReceiver.java:230) at org.mule.impl.work.WorkerContext.run(WorkerContext.java:290) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:643) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:668) at java.lang.Thread.run(Thread.java:534) As you can see from the stack, I'm using the Length protocol. Here's my basic UMO config; <mule-descriptor name="ConfigServiceUMO" implementation="configController"> <inbound-router> <endpoint synchronous="true" address="${ew.esb.service.config.queue.tcp}" transformers="BytesToString XmlToObject" responseTransformers="ObjectToXml"></endpoint> </inbound-router> <interceptor className="default" /> </mule-descriptor> I've played around with setting the remoteSync params ( I admit, I have no idea what they're for ) but this appears to have no effect. Is there something I'm missing that would cause the server to continue reading from the TCP socket? Thanks, Mark
Hide
Permalink
Ross Mason added a comment - 23/Jun/06 06:27 AM

Hi Mark, Is this issue still open for you?

Show
Ross Mason added a comment - 23/Jun/06 06:27 AM Hi Mark, Is this issue still open for you?
Hide
Permalink
Holger Hoffstaette added a comment - 21/Jan/07 09:53 AM

Most likely caused by a bug related to socket state management.

Show
Holger Hoffstaette added a comment - 21/Jan/07 09:53 AM Most likely caused by a bug related to socket state management.

People

  • Assignee:
    Holger Hoffstaette
    Reporter:
    Mark Koch
Vote (0)
Watch (1)

Dates

  • Created:
    31/Oct/05 04:57 PM
    Updated:
    21/Jan/07 09:53 AM
    Resolved:
    21/Jan/07 09:53 AM

Agile

  • View on Board
  • Atlassian JIRA (v5.0.7#734-sha1:8ad78a6)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for MuleForge. Try JIRA - bug tracking software for your team.