amit170394 / sardine

Automatically exported from code.google.com/p/sardine
0 stars 0 forks source link

Sardine hangs on return this.client.execute(base); #26

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I encountered a deadlock:

    if( sar.exists( DIR_URL ) )
      sar.delete( DIR_URL );
    sar.createDirectory( DIR_URL );
    sar.exists( DIR_URL );
    sar.put(FILE_URL, CONTENT.getBytes("utf-8") );
    sar.exists( FILE_URL ); // <--- hangs here

Callstack attached.

Original issue reported on code.google.com by dynaw...@gmail.com on 25 Feb 2010 at 4:12

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by dynaw...@gmail.com on 25 Feb 2010 at 4:16

Attachments:

GoogleCodeExporter commented 9 years ago
Interesting. I'm guessing this is part of my use of the 
ThreadSafeClientConnManager in 
HttpClient. The 6th call is failing, so there must be some limit of 5. I'll 
take a look into 
fixing this. For now, the work around is to stop calling exists() so many 
times. =)

Original comment by latch...@gmail.com on 25 Feb 2010 at 4:26

GoogleCodeExporter commented 9 years ago

Original comment by latch...@gmail.com on 25 Feb 2010 at 4:26

GoogleCodeExporter commented 9 years ago
:)  IMHO it's a bug in HttpClient, since your usage of 
ThreadSafeClientConnManager
seems to be correct. I'd try with older HttpClient if possible. But only 
guessing.

Original comment by dynaw...@gmail.com on 25 Feb 2010 at 5:25

GoogleCodeExporter commented 9 years ago
Could you please add some option whether to use thread safe or unsafe manager? 
That
could be a temporary workaround...

Original comment by dynaw...@gmail.com on 25 Feb 2010 at 5:27

GoogleCodeExporter commented 9 years ago
Yea, I've been trying to think of a good way to do that.

Original comment by latch...@gmail.com on 25 Feb 2010 at 5:34

GoogleCodeExporter commented 9 years ago
I think the problem is in HttpClient's synchronization between
ConnPoolByRoute.java@323 and WaitingThread.

Original comment by dynaw...@gmail.com on 25 Feb 2010 at 6:17

GoogleCodeExporter commented 9 years ago
When uring httpclient 3.1 with jackrabbit webdav client the connection had to 
be 
released manually using PutMethod#releaseConnection() after execution. You sure 
4.1 
releases connections automatically.

Original comment by priitlii...@gmail.com on 17 Apr 2010 at 8:02

GoogleCodeExporter commented 9 years ago
rtfm for httpclient 4.x please.

Original comment by latch...@gmail.com on 17 Apr 2010 at 3:13

GoogleCodeExporter commented 9 years ago
I've hit this problem as well. The workaround that worked for me was to release 
the
connection manually in branches that throw SardineException. So it looks that
HttpClient will not release the connection if you only check the status code...

Manual release is performed via response.getEntity().getContent().close()

Original comment by pdud...@gmail.com on 31 May 2010 at 1:26

GoogleCodeExporter commented 9 years ago
Calling HttpRequestBase.abort() makes even more sense. Attached is patch agains 
Rev. 128

Original comment by pdud...@gmail.com on 31 May 2010 at 1:33

Attachments:

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r129.

Original comment by latch...@gmail.com on 1 Jun 2010 at 12:36