commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Parks" <>
Subject RE: [Email] Email send hangs thread indefinitely on intermittent failure
Date Sat, 21 Aug 2010 20:30:07 GMT
Oh what a bugger, I see these two options are available in 1.2, but the
javadocs on the website are out of date (they don't show these two options).
And yep, that's what I needed to fix the problem. I'll put in a patch
suggestion to set these to default values out of the box. We definitely
shouldn't have to think at this level with a wrapper API expected to be used
in server apps.

Thanks much!

-----Original Message-----
From: Siegfried Goeschl [] 
Sent: Saturday, August 21, 2010 12:05 AM
To: Commons Users List
Subject: Re: [Email] Email send hangs thread indefinitely on intermittent

Hi David,

don't know if you have set any timeouts for your tests such as

+) Email.setSocketConnectionTimeout()
+) Email.setSocketTimeout()

The first two go into the email session for (javax.mail) while the two
others are set directly on Email - see


Siegfried Goeschl

PS: Agreed on the fact the you should not hang indefinitely with a default

On 21.08.10 05:23, David Parks wrote:
> I set up a simple test to send 50 emails through google app's SMTP server
> with a short delay between them (just testing to see what I'm allowed to
> do).
> I set this up by opening 50 threads and pausing at different intervals for
> each thread.
> I notice that I sometimes end up with a thread that hangs indefinitely on
> connection that seems to be hung, but never times out (see the thread dump
> below for one such case, it's been left hung for>  10 min now):
> Any thoughts on this? Kind of scares me to think what might happen to a
> server posting emails in the background. I would expect network timeouts
> all be handled at least with a default value by a simplifying wrapper
> such as this is. Or am I missing some logic here maybe?
> Thanks,
> David
> Thread [Thread-23] (Suspended)	
> 	SocketInputStream.socketRead0(FileDescriptor, byte[], int, int, int)
> line: not available [native method]	
>[], int, int) line: not available	
> 	InputRecord.readFully(InputStream, byte[], int, int) line: not
> available	
>, OutputStream) line: not available	
> 	SSLSocketImpl.readRecord(InputRecord, boolean) line: not available
> 	SSLSocketImpl.readDataRecord(InputRecord) line: not available	
>[], int, int) line: not available	
>[], int, int) line: 106	
> 	BufferedInputStream.fill() line: not available	
> line: not available	
> 	LineInputStream.readLine() line: 84	
> 	SMTPTransport.readServerResponse() line: 1903	
> 	SMTPTransport.issueSendCommand(String, int) line: 1808	
> 	SMTPTransport.finishData() line: 1634	
> 	SMTPTransport.sendMessage(Message, Address[]) line: 889	
> 	Transport.send0(Message, Address[]) line: 191	
> 	Transport.send(Message) line: 120	
> 	HtmlEmail(Email).sendMimeMessage() line: 1232	
> 	HtmlEmail(Email).send() line: 1267	
> 	GoogleAppsEmailTest.sendEmail(int) line: 51	
> 	GoogleAppsEmailTest$ line: 17	
> line: not available	
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message