Re: Thread sleeps forever on LoggedDataInputStream

Martin Entlicher <[email protected]> Tue, 26 Oct 2004 11:39:28 +0200
Newsgroups gmane.comp.java.netbeans.modules.javacvs.devel
Message-ID <[email protected]>
Hi Arjen,

do you have the n instances of Client over a single connection? It seems 
that the problem can be caused by multiple commands sharing the same 
stream.  Please assure that you have a different connection for every 
command.

Regards,
Martin

Arjen Smedes wrote:

>Hi,
>
>I have found a few issues that deal with multi-threading in the javacvs 
>library. I haven't found the problem I am facing at the moment.
>
>I am running n parallel Client threads (RlogCommands or UpdateCommands) on a 
>cvs repository. Sometimes it works fine, but sometimes my application blocks. 
>If I debug the lot, it turns out that a few threads are waiting forever. 
>Here's a snippet from the thread dump:
>
>"Thread-91" prio=1 tid=0x08073038 nid=0x2fc0 waiting on condition 
>[4efa2000..4efa2cd0]
>	at java.lang.Thread.sleep(Native Method)
>	at 
>org.netbeans.lib.cvsclient.util.LoggedDataInputStream.readLine(LoggedDataInputStream.java:51)
>	at 
>org.netbeans.lib.cvsclient.connection.PServerConnection.openConnection(PServerConnection.java:188)
>	at 
>org.netbeans.lib.cvsclient.connection.PServerConnection.open(PServerConnection.java:300)
>	at org.netbeans.lib.cvsclient.Client.ensureConnection(Client.java:270)
>	at 
>org.netbeans.lib.cvsclient.command.log.RlogCommand.execute(RlogCommand.java:263)
>	at org.netbeans.lib.cvsclient.Client.executeCommand(Client.java:533)
>	at 
>nl.toolforge.karma.core.vc.cvsimpl.CVSRunner.executeOnCVS(CVSRunner.java:564)
>	at nl.toolforge.karma.core.vc.cvsimpl.CVSRunner.log(CVSRunner.java:453)
>	at 
>nl.toolforge.karma.core.vc.cvsimpl.threads.CVSLogThread.run(CVSLogThread.java:65)
>
>
>The more I increase "Thread.currentThread().sleep(200);" in 
>LoggedDataInputStream.readLine(), the more certain I am from this blocking 
>situation happening, although if I set it to 0, it happened to me as well.
>
>I haven't got a clue as yet. 
>
>In the mean time, I'll keep looking myself, as it is blocking for my project.
>
>Any help is appreciated.
>
>Regards,
>
>Arjen.
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [email protected]
>For additional commands, e-mail: [email protected]
>
>  
>