Skip to content

Conversation

@DiogoSantoss
Copy link
Contributor

Functions SendReceive and Send create a libp2p stream to send a message to a peer that is closed at the end. Upon enabling QUIC an error close called for canceled stream start appearing more often which would cause the function to return the error signaling a failure in sending the message. This would trigger a retry mechanism and add lots of logs.

Upon testing, we verified that this retry is not necessary since the destination peer would receive the message anyways even if we failed to close the stream. This should also not cause any leaks since the stream was canceled.

We still do not know who/what is causing the stream to be canceled.
The PR simply aims to reduce unnecessary retries and logs.

category: bug
ticket: none

@DiogoSantoss DiogoSantoss self-assigned this Aug 19, 2025
@sonarqubecloud
Copy link

@codecov
Copy link

codecov bot commented Aug 19, 2025

Codecov Report

❌ Patch coverage is 0% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 55.06%. Comparing base (d977440) to head (0e55d13).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
p2p/sender.go 0.00% 14 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3916      +/-   ##
==========================================
- Coverage   55.07%   55.06%   -0.02%     
==========================================
  Files         225      225              
  Lines       36842    36854      +12     
==========================================
+ Hits        20291    20292       +1     
- Misses      14410    14422      +12     
+ Partials     2141     2140       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator

@KaloyanTanev KaloyanTanev left a comment

Choose a reason for hiding this comment

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

Approving with the assumption that the elaborate tests we've done still result in success.

@DiogoSantoss DiogoSantoss added the merge when ready Indicates bulldozer bot may merge when all checks pass label Aug 20, 2025
@obol-bulldozer obol-bulldozer bot merged commit 10d135b into main Aug 20, 2025
11 of 13 checks passed
@obol-bulldozer obol-bulldozer bot deleted the diogo/close-error branch August 20, 2025 08:32
DiogoSantoss added a commit that referenced this pull request Aug 20, 2025
Functions `SendReceive` and `Send` create a libp2p stream to send a message to a peer that is closed at the end. Upon enabling QUIC an error `close called for canceled stream` start appearing more often which would cause the function to return the error signaling a failure in sending the message. This would trigger a retry mechanism and add lots of logs.

Upon testing, we verified that this retry is not necessary since the destination peer would receive the message anyways even if we failed to close the stream. This should also not cause any leaks since the stream was canceled.

We still do not know who/what is causing the stream to be canceled.
The PR simply aims to reduce unnecessary retries and logs.

category: bug 
ticket: none
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge when ready Indicates bulldozer bot may merge when all checks pass

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants