Re: [Simpleweb-Support] Deadlock in org.simpleframework.transport.SocketWriter.flush ??
Brought to you by:
niallg
|
From: <nia...@rb...> - 2010-03-25 17:34:10
|
Hi,
I have noticed a slight issue in the SocketWriter, and although I have never experienced this problem myself it is still possible to cause the loop you mention. Here are the return codes for the FileChannelImpl.
35 static final int EOF = -1; // End of file
36 static final int UNAVAILABLE = -2; // Nothing available (non-blocking)
37 static final int INTERRUPTED = -3; // System call interrupted
38 static final int UNSUPPORTED = -4; // Operation not supported
39 static final int THROWN = -5; // Exception thrown in JNI code
40 static final int UNSUPPORTED_CASE = -6; // This case not supported
So here I say
if(size == 0) {
break;
}
Then add to count, and check if count > 0. However as you can see if -1 to -6 is returned a loop will occur. I have attached the SocketWriter that will fix this. I will release a new version with this fix shortly.
Thanks,
Niall
-----Original Message-----
From: GALLAGHER, Niall, GBM
Sent: 24 March 2010 18:55
To: 'Simple support and user issues'
Subject: RE: [Simpleweb-Support] Deadlock in org.simpleframework.transport.SocketWriter.flush ??
Ok, thanks, I will investigate this further. Looks like the bug could be in the SegmentBuilder.
Thanks,
Niall
Niall Gallagher
RBS Global Banking & Markets
Office: +44 2070851454
-----Original Message-----
From: Christophe Roudet [mailto:cr...@ac...]
Sent: 24 March 2010 18:20
To: sim...@li...
Subject: Re: [Simpleweb-Support] Deadlock in org.simpleframework.transport.SocketWriter.flush ??
I had the same problem happening sometimes to times, stuck in
SocketWriter.flush() where segment was null.
Christophe
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Simpleweb-Support mailing list
Sim...@li...
https://lists.sourceforge.net/lists/listinfo/simpleweb-support
***********************************************************************************
The Royal Bank of Scotland plc. Registered in Scotland No 90312.
Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB.
Authorised and regulated by the Financial Services Authority. The
Royal Bank of Scotland N.V. is authorised and regulated by the
De Nederlandsche Bank and has its seat at Amsterdam, the
Netherlands, and is registered in the Commercial Register under
number 33002587. Registered Office: Gustav Mahlerlaan 10,
Amsterdam, The Netherlands. The Royal Bank of Scotland N.V. and
The Royal Bank of Scotland plc are authorised to act as agent for each
other in certain jurisdictions.
This e-mail message is confidential and for use by the addressee only.
If the message is received by anyone other than the addressee, please
return the message to the sender by replying to it and then delete the
message from your computer. Internet e-mails are not necessarily
secure. The Royal Bank of Scotland plc and The Royal Bank of Scotland
N.V. including its affiliates ("RBS group") does not accept responsibility
for changes made to this message after it was sent.
Whilst all reasonable care has been taken to avoid the transmission of
viruses, it is the responsibility of the recipient to ensure that the onward
transmission, opening or use of this message and any attachments will
not adversely affect its systems or data. No responsibility is accepted
by the RBS group in this regard and the recipient should carry out such
virus and other checks as it considers appropriate.
Visit our website at www.rbs.com
***********************************************************************************
|