Clarify Javadoc for responseTimeout and socketTimeout interaction#712
Clarify Javadoc for responseTimeout and socketTimeout interaction#712LichKing-lee wants to merge 4 commits into
Conversation
952cbb6 to
f599f76
Compare
f599f76 to
caa748a
Compare
| * connections created by this configuration. | ||
| * A timeout value of zero is interpreted as an infinite timeout. | ||
| * <p> | ||
| * This value acts as a baseline configured by the I/O layer. It can be |
There was a problem hiding this comment.
@LichKing-lee Actually this is not quite correct. The baseline is established by the respective i/o layer (through SocketConfig for the classic one or IOReactorConfig for the async one). Those settings apply to all newly created connections / channels indiscriminately. ConnectionConfig is one layer up and can apply selectively to specific hosts. This is reason ConnectionConfig exists, so one could configure different connection settings for specific hosts only.
| * </p> | ||
| * <p> | ||
| * This parameter may override a socket timeout configured at the connection | ||
| * or I/O layers for the duration of a message execution. It is not a hard |
There was a problem hiding this comment.
@LichKing-lee Not quite. It does not apply to the entire duration of a message exchange. It defines the maximum period of inactivity between sending of a request message and receipt of a response message head. Once a response head has been received the connection socket timeout gets reset back to its previous value and the content of the response message gets consumed with the socket timeout configured at the connection or i/o layers.
|
@LichKing-lee I committed your changes as 67f56a2 with some minor changes. Thank you for contributing this improvement. |
What problem does this solve?
The Javadoc for responseTimeout and socketTimeout does not clearly describe their interaction. Many users assume they are independent, but in classic I/O responseTimeout actually overrides the connection’s socketTimeout during request execution. This can cause confusion when diagnosing timeout behavior.
What does this PR do?
This PR updates the Javadoc of both RequestConfig#setResponseTimeout and ConnectionConfig#setSocketTimeout to explicitly document that behavior: