Skip to content
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

Don't throw unchecked exceptions when creating requests for builders #6111

Conversation

StefanBratanov
Copy link
Contributor

@StefanBratanov StefanBratanov commented Aug 22, 2022

PR Description

All exceptions are currently handled in the OkHttp callback onFailure method.

This PR makes sure no unchecked exception (different from expected IOException) is thrown in RequestBody.writeTo method. If such is thrown, then an exception will be thrown in a background thread, which will trigger TekuDefaultExceptionHandler to print a scary log message.

Fixed Issue(s)

fixes #6109

Documentation

  • I thought about documentation and added the doc-change-required label to this PR if updates are required.

Changelog

  • I thought about adding a changelog entry, and added one if I deemed necessary.

@StefanBratanov StefanBratanov changed the title Close resources when sending requests to builder Don't throw unchecked exceptions when sending requests to builders Aug 23, 2022
@StefanBratanov StefanBratanov changed the title Don't throw unchecked exceptions when sending requests to builders Don't throw unchecked exceptions when creating requests for builders Aug 23, 2022
Copy link
Contributor

@tbenr tbenr left a comment

Choose a reason for hiding this comment

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

LGTM.
Even if its only in test code, pinging @ajsutton for an approval on adding awaitility dependency.

@StefanBratanov
Copy link
Contributor Author

StefanBratanov commented Aug 24, 2022

LGTM. Even if its only in test code, pinging @ajsutton for an approval on adding awaitility dependency.

Cool, I used it to get the catchUncaughtExceptions functionality, which fails the test if exceptions are caught in background threads. Otherwise, needed to create a separate thread and attach a test handler to it.

@StefanBratanov StefanBratanov force-pushed the close_stream_builder_rest_client branch from 469caf2 to bb17887 Compare August 26, 2022 07:25
@StefanBratanov StefanBratanov enabled auto-merge (squash) August 26, 2022 07:25
@StefanBratanov StefanBratanov merged commit 6a0d8a5 into Consensys:master Aug 26, 2022
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.

Error Failed to send validator registrations to Beacon Node when using MEV-Boost on Goerli
4 participants