Guillaume,

Isn't the poll method called concurrently when multiple <ftp:poller/>s exist?
Gert

Guillaume Nodet wrote:
Hi Guert !

Yeah, I guess the accept operation on the socket should timeout somehow,
but this would be an enhancement in commons-net (maybe they know what
to do for handling such problems ...).
Another way would be to improve the pooling strategy with timeouts, aso ...

But what seems weird is that there are 8 threads blocked in the poll method, which should not be called concurrently. So there is at least a bug there
-- please raise a JIRA for this one :-)

On 3/30/07, Gert Vanthienen <[EMAIL PROTECTED]> wrote:

L.S.,


After some time of well-behaved operations, the FTP poller stalls...
Below, you find a set of thread dumps.  If I interpret this data
correctly, the poller threads are waiting on a network operation to
complete, causing the connection pool to become empty --threads waiting
on GenericObjectPool.borrowObject()--.  How do I avoid this?  Is there a
way to set a time-out somewhere?  Or is this a bug and should I raise an
issue for this --and attach a patch afterwards ;) -- ?


Regards,

Gert



1 thread performing timed wait (which is good)
-----------------------------------------------
Name: pool-component.servicemix-ftp-thread-1
State: TIMED_WAITING on
[EMAIL PROTECTED]
Total blocked: 0  Total waited: 429.516

Stack trace:
    java.lang.Object.wait(Native Method)
    java.lang.Object.wait(Object.java:432)

edu.emory.mathcs.backport.java.util.concurrent.TimeUnit.timedWait(
TimeUnit.java:301)

edu.emory.mathcs.backport.java.util.concurrent.locks.CondVar.await(
CondVar.java:103)

edu.emory.mathcs.backport.java.util.concurrent.ArrayBlockingQueue.poll(
ArrayBlockingQueue.java:345)

org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.accept(
DeliveryChannelImpl.java:252)

org.apache.servicemix.common.AsyncBaseLifeCycle.pollDeliveryChannel(
AsyncBaseLifeCycle.java:266)

org.apache.servicemix.common.AsyncBaseLifeCycle$1.run(
AsyncBaseLifeCycle.java:252)


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)

8 threads that are waiting on some kind of network operation
-------------------------------------------------------------
Name: pool-component.servicemix-ftp-thread-9
State: RUNNABLE
Total blocked: 742.403  Total waited: 35.249

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)

23 threads that are waiting to get a connection from the pool
-------------------------------------------------------------
Name: pool-component.servicemix-ftp-thread-32
State: WAITING on [EMAIL PROTECTED]
Total blocked: 301  Total waited: 17

Stack trace:
    java.lang.Object.wait(Native Method)
    java.lang.Object.wait(Object.java:474)

org.apache.commons.pool.impl.GenericObjectPool.borrowObject(
GenericObjectPool.java:748)

org.apache.servicemix.ftp.SocketClientPoolSupport.borrowClient(
SocketClientPoolSupport.java:61)

org.apache.servicemix.ftp.FtpPollerEndpoint.borrowClient(
FtpPollerEndpoint.java:323)

org.apache.servicemix.ftp.FtpPollerEndpoint.pollFileOrDirectory(
FtpPollerEndpoint.java:200)

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)






Reply via email to