Skip to content

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

Merged
abitmore merged 1 commit intomasterfrom
update-asio-error
Nov 18, 2023
Merged

Rethrow more asio operation cancellation exception as fc::canceled_exception#251
abitmore merged 1 commit intomasterfrom
update-asio-error

Conversation

@abitmore
Copy link
Copy Markdown
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
@sonarqubecloud
Copy link
Copy Markdown

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

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.

1 participant