You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@servicemix.apache.org by "Gert Vanthienen (JIRA)" <ji...@apache.org> on 2007/04/03 09:36:34 UTC

[jira] Commented: (SM-915) FTP poller stalls with threads waiting on PlainSocketImpl.socketAccept()

    [ https://issues.apache.org/activemq/browse/SM-915?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_38944 ] 

Gert Vanthienen commented on SM-915:
------------------------------------

Some additional observations - the problem only appears when:
* when a lot of files become available on the FTP server together
* some of them are being downloaded before they are complete, i.e. incomplete XML messages are being read and processing fails for these messages

In the FTP poller code, we find 
{code}
InputStream in = ftp.retrieveFileStream(file);
InOnly exchange = getExchangeFactory().createInOnlyExchange();
configureExchangeTarget(exchange);
NormalizedMessage message = exchange.createMessage();
exchange.setInMessage(message);
marshaler.readMessage(exchange, message, in, file);
sendSync(exchange);
in.close();
ftp.completePendingCommand();
{code}

My question: Is it possible that {{sendSync(exchange)}} throws an Exception when an incomplete XML message is retrieved from the server?  If it does, the inputstream is never closed and {{completePendingCommand()}} is never called, which might explain the problems


> FTP poller stalls with threads waiting on PlainSocketImpl.socketAccept()
> ------------------------------------------------------------------------
>
>                 Key: SM-915
>                 URL: https://issues.apache.org/activemq/browse/SM-915
>             Project: ServiceMix
>          Issue Type: Bug
>          Components: servicemix-ftp
>    Affects Versions: 3.1
>            Reporter: Gert Vanthienen
>
> FTP poller threads stop working with the stack trace below, causing the FTP client pool to run out of connections
> {code}
> Name: pool-component.servicemix-ftp-thread-2
> State: RUNNABLE
> Total blocked: 78,430  Total waited: 4,771
> Stack trace: 
>     java.net.PlainSocketImpl.socketAccept(Native Method)
>     java.net.PlainSocketImpl.accept(PlainSocketImpl.java:384)
>     java.net.ServerSocket.implAccept(ServerSocket.java:450)
>     java.net.ServerSocket.accept(ServerSocket.java:421)
>     org.apache.commons.net.ftp.FTPClient._openDataConnection_(FTPClient.java:502)
>     org.apache.commons.net.ftp.FTPClient.initiateListParsing(FTPClient.java:2390)
>     org.apache.commons.net.ftp.FTPClient.initiateListParsing(FTPClient.java:2364)
>     org.apache.commons.net.ftp.FTPClient.listFiles(FTPClient.java:2141)
>     org.apache.servicemix.ftp.FtpPollerEndpoint.pollFileOrDirectory(FtpPollerEndpoint.java:211)
>     org.apache.servicemix.ftp.FtpPollerEndpoint.pollFileOrDirectory(FtpPollerEndpoint.java:203)
>     org.apache.servicemix.ftp.FtpPollerEndpoint.poll(FtpPollerEndpoint.java:78)
>     org.apache.servicemix.common.endpoints.PollingEndpoint$PollSchedulerTask$1.run(PollingEndpoint.java:155)
>     edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
>     edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
>     java.lang.Thread.run(Thread.java:595)
> {code}
> See http://www.nabble.com/FTP-poller-stalls...-tf3490690s12049.html for more information

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