-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Add connection timeout to TLS Channel #1686
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
JAVA-5856
|
||
SSLParameters sslParameters = sslEngine.getSSLParameters(); | ||
enableSni(getServerAddress().getHost(), sslParameters); | ||
group.getTimeoutExecutor().schedule(() -> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For better scalability, I believe we should use a dedicated timeout executor for connection timeouts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't group.getTimeoutExecutor()
dedicated to timeouts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is. What I meant is that if an application schedules read and write timeouts at a high rate, a single thread might not keep up and could sometimes overshoot. A dedicated thread for connection timeouts could help offload some work. However, this is a speculative assumption - and one thread might be sufficient.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I propose us to not create any more internal threads than we already have, unless that's either necessary, or we have evidence that the existing ones do not suffice.
driver-core/src/main/com/mongodb/internal/connection/TlsChannelStreamFactoryFactory.java
Outdated
Show resolved
Hide resolved
JAVA-5856
driver-core/src/main/com/mongodb/internal/connection/TlsChannelStreamFactoryFactory.java
Outdated
Show resolved
Hide resolved
driver-core/src/main/com/mongodb/internal/connection/TlsChannelStreamFactoryFactory.java
Outdated
Show resolved
Hide resolved
driver-core/src/main/com/mongodb/internal/connection/TlsChannelStreamFactoryFactory.java
Outdated
Show resolved
Hide resolved
driver-core/src/main/com/mongodb/internal/connection/TlsChannelStreamFactoryFactory.java
Outdated
Show resolved
Hide resolved
driver-core/src/main/com/mongodb/internal/connection/TlsChannelStreamFactoryFactory.java
Outdated
Show resolved
Hide resolved
driver-core/src/main/com/mongodb/internal/connection/TlsChannelStreamFactoryFactory.java
Outdated
Show resolved
Hide resolved
driver-core/src/main/com/mongodb/internal/connection/TlsChannelStreamFactoryFactory.java
Outdated
Show resolved
Hide resolved
driver-core/src/main/com/mongodb/internal/connection/TlsChannelStreamFactoryFactory.java
Outdated
Show resolved
Hide resolved
driver-core/src/main/com/mongodb/internal/connection/TlsChannelStreamFactoryFactory.java
Show resolved
Hide resolved
driver-core/src/main/com/mongodb/internal/connection/TlsChannelStreamFactoryFactory.java
Outdated
Show resolved
Hide resolved
The last reviewed commit is 238268c. |
…lStreamFactoryFactory.java Co-authored-by: Valentin Kovalenko <valentin.male.kovalenko@gmail.com>
JAVA-5856
I pressed approve, to show that my concerns were resolved. However, the code is still draft and contains TODOs, and many tests fail. That is, we can't merge it as is. The last reviewed commit is 839e51d. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The last reviewed commit is b6244f4. Even the static checks do not pass, which also means that the code wasn't built locally to see if it produces any new warnings (not all warnings result in a build failure).
...core/src/test/functional/com/mongodb/internal/connection/TlsChannelStreamFunctionalTest.java
Outdated
Show resolved
Hide resolved
...core/src/test/functional/com/mongodb/internal/connection/TlsChannelStreamFunctionalTest.java
Outdated
Show resolved
Hide resolved
...core/src/test/functional/com/mongodb/internal/connection/TlsChannelStreamFunctionalTest.java
Outdated
Show resolved
Hide resolved
...core/src/test/functional/com/mongodb/internal/connection/TlsChannelStreamFunctionalTest.java
Outdated
Show resolved
Hide resolved
...core/src/test/functional/com/mongodb/internal/connection/TlsChannelStreamFunctionalTest.java
Outdated
Show resolved
Hide resolved
JAVA-5856
JAVA-5856
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The last reviewed commit is 39ee2fe.
...core/src/test/functional/com/mongodb/internal/connection/TlsChannelStreamFunctionalTest.java
Outdated
Show resolved
Hide resolved
...core/src/test/functional/com/mongodb/internal/connection/TlsChannelStreamFunctionalTest.java
Show resolved
Hide resolved
…n/TlsChannelStreamFunctionalTest.java Co-authored-by: Valentin Kovalenko <valentin.male.kovalenko@gmail.com>
…n/TlsChannelStreamFunctionalTest.java Co-authored-by: Valentin Kovalenko <valentin.male.kovalenko@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if tests fail because main
is broken, or because there is an issue with this PR. But otherwise approving.
The last reviewed commit is 48d3a52.
Tests are passing after the recent fix on the main branch, which I’ve merged into this PR. |
JAVA-5856