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

Rethrow more asio operation cancellation exception as fc::canceled_exception #251

Merged
merged 1 commit into from Nov 18, 2023

Conversation

abitmore
Copy link
Member

@abitmore abitmore commented Nov 18, 2023

Rethrow more asio operation cancellation exception boost::asio::error::operation_aborted as fc::canceled_exception instead of fc::exception in read/write handlers to fix errors like below.

p2p:connect_to_task connect_to ] Failed to connect to remote endpoint x.x.x.x:x from local endpoint 0.0.0.0:x, will connect using an OS-selected endpoint: {"code":0,"name":"exception","message":"unspecified","stack":[{"context":{"level":"error","file":"asio.cpp","line":41,"method":"error_handler","hostname":"","thread_name":"fc::asio worker #1","timestamp":"x-x-xTx:x:x"},"format":"${message} ","data":{"message":"Operation canceled"}}]}

See also #249.

Note that this PR and #249 essentially revert f8472af and a part of 751777e . The commit f8472af says:

Change fc::canceled_exceptions thrown due to a socket operation being canceled into regular fc::exceptions -- we're reserving canceled_exception for canceling async tasks

But I think async task cancellation will trigger socket operation abortion, we need a fc::calceled_exception to handle it correctly.

... `boost::asio::error::operation_aborted` as `fc::canceled_exception`
instead of `fc::exception` in read/write handlers
@abitmore abitmore added this to the core release 7.0.1 milestone Nov 18, 2023
Copy link

sonarcloud bot commented Nov 18, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
94.1% 94.1% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

@abitmore abitmore merged commit 3ea07ea into master Nov 18, 2023
9 of 10 checks passed
@abitmore abitmore deleted the update-asio-error branch February 6, 2024 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant