Skip navigation

Email Engine should support socket timeout for SSL socket

score 110
You have not voted. Below Review Threshold

Use case: Customer is using a cloud based solution as their email server. Email Engine is configured to fetch emails from the mailserver via SSL connection.

 

Recently some problem caused the SSL handshake to hang in the ClientHello and the email engine waited for continuation forever.

This essentially caused the email engine to hang and not fetch mails until it got restarted.

 

The steps to troubleshoot the "hang" of the email engine were quite extensive and identfiying the cause of the hang took some time.

 

Therefore it would be great if the email engine would implement a nonzero sockettimeout as described in eg.

Socket (Java Platform SE 8 )

setSoTimeout

public void setSoTimeout(int timeout) throws SocketException

Enable/disable SO_TIMEOUT with the specified timeout, in milliseconds. With this option set to a non-zero timeout, a read() call on the InputStream associated with this Socket will block for only this amount of time. If the timeout expires, a java.net.SocketTimeoutException is raised, though the Socket is still valid. The option must be enabled prior to entering the blocking operation to have effect. The timeout must be > 0. A timeout of zero is interpreted as an infinite timeout.

Parameters:
timeout - the specified timeout, in milliseconds.
Throws:
SocketException - if there is an error in the underlying protocol, such as a TCP error
for the SSL socket.
This would enable Email Engine to detect such error conditons and terminate the connection and throw an appropriate error, which would make troubleshooting much easier.
Ideally the email engine should implement timeouts for all sockets and not restrict this idea to the SSL socket alone.
Further references:

Comments

Vote history