Skip to content

Correctly handle task offloading when using BoringSSL / OpenSSL#9575

Merged
normanmaurer merged 2 commits into
4.1from
ssl_task_fixes
Sep 19, 2019
Merged

Correctly handle task offloading when using BoringSSL / OpenSSL#9575
normanmaurer merged 2 commits into
4.1from
ssl_task_fixes

Conversation

@normanmaurer
Copy link
Copy Markdown
Member

Motivation:

We did not correctly handle taskoffloading when using BoringSSL / OpenSSL. This could lead to the situation that we did not write the SSL alert out for the remote peer before closing the connection.

Modifications:

  • Correctly handle exceptions when we resume processing on the EventLoop after the task was offloadded
  • Ensure we call SSL.doHandshake(...) to flush the alert out to the outboundbuffer when an handshake exception was detected
  • Correctly signal back the need to call WRAP again when a handshake exception is pending. This will ensure we flush out the alert in all cases.

Result:

No more failures when task offloading is used.

Motivation:

We did not correctly handle taskoffloading when using BoringSSL / OpenSSL. This could lead to the situation that we did not write the SSL alert out for the remote peer before closing the connection.

Modifications:

- Correctly handle exceptions when we resume processing on the EventLoop after the task was offloadded
- Ensure we call SSL.doHandshake(...) to flush the alert out to the outboundbuffer when an handshake exception was detected
- Correctly signal back the need to call WRAP again when a handshake exception is pending. This will ensure we flush out the alert in all cases.

Result:

No more failures when task offloading is used.
@normanmaurer normanmaurer added this to the 4.1.42.Final milestone Sep 18, 2019
@normanmaurer
Copy link
Copy Markdown
Member Author

@netty-bot test this please

@johnou
Copy link
Copy Markdown
Contributor

johnou commented Sep 18, 2019

am I the only one using ssl tasks? 😀

Copy link
Copy Markdown
Member

@ejona86 ejona86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fair, but the try-catch is the main thing I understand :-)

@normanmaurer normanmaurer merged commit 57e0481 into 4.1 Sep 19, 2019
@normanmaurer normanmaurer deleted the ssl_task_fixes branch September 19, 2019 06:17
normanmaurer added a commit that referenced this pull request Sep 19, 2019
Motivation:

We did not correctly handle taskoffloading when using BoringSSL / OpenSSL. This could lead to the situation that we did not write the SSL alert out for the remote peer before closing the connection.

Modifications:

- Correctly handle exceptions when we resume processing on the EventLoop after the task was offloadded
- Ensure we call SSL.doHandshake(...) to flush the alert out to the outboundbuffer when an handshake exception was detected
- Correctly signal back the need to call WRAP again when a handshake exception is pending. This will ensure we flush out the alert in all cases.

Result:

No more failures when task offloading is used.
David-Noble-at-work pushed a commit to Azure/azure-cosmosdb-java that referenced this pull request Oct 12, 2019
David-Noble-at-work pushed a commit to Azure/azure-cosmosdb-java that referenced this pull request Oct 15, 2019
…cult to interpret #273 (#274)

* Corrected an error in RequestRateTooLargeException, a regression that caused the status code to be set incorrectly

* Corrected ServiceUnavailableException status code, optimized imports, and added DocumentClientExceptionTest.statusCodeIsCorrect

The latter resulted in moving DocuemntClientExceptionTest from commons to direct-impl. Without the move commons would need to take a dependency on direct-impl which seems undesirable.

* Refactored DocumentClientExceptionTest to spread it out between commons and direct-impl

* Bumped version number to 2.6.3-SNAPSHOT

* Bumped netty version number to pickup this and other fixes: netty/netty#9575

* Improved error handling for RntbdResponseHeaders

* Improved an error message
kushagraThapar pushed a commit to Azure/azure-cosmosdb-java that referenced this pull request Dec 2, 2019
* Corrected an error in RequestRateTooLargeException, a regression that caused the status code to be set incorrectly

* Corrected ServiceUnavailableException status code, optimized imports, and added DocumentClientExceptionTest.statusCodeIsCorrect

The latter resulted in moving DocuemntClientExceptionTest from commons to direct-impl. Without the move commons would need to take a dependency on direct-impl which seems undesirable.

* Refactored DocumentClientExceptionTest to spread it out between commons and direct-impl

* Bumped version number to 2.6.3-SNAPSHOT

* Bumped netty version number to pickup this and other fixes: netty/netty#9575

* Improved error handling for RntbdResponseHeaders

* Improved an error message

* Resolved #275

* Minor code cleanup in the vicinity of one possible source of this issue

* Tweaks

* Added logger.info that reports the ssl provider (OPENSSL or JVM)

* Improved diagnostics

* Added state tracking to RntbdRequestRecord so that the logs reveal the state of a request when it times out

* Tweaked text of RequestTimeoutException produced by RntbdRequestRecord.expire

* Added RntbdRequestRecord.State.UNSENT to denote failed writes

* Sorted methods and improved checkArgument messages

* Tweaks

* Added logger for tracking hashed wheel timer stops

* Added debug logger message

* Tweaked comments and line spacing

* Added final modifier

* Added requestExpiryInterval to RntbdTransportClient.Options

* Version bump

* Tweaks for performance testing

* Port from azure-cosmos-4.X

* Removed extraneous file

* Updated changelog to force a rebuild

* Fixed a test break

* Corrected package names in logger configuration file

* Updated changelog that tracks unreleased changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants