Skip to content

fix(volo-thrift): unexpected UnexpectedEof Err returned by DefaultDec…#647

Merged
shenyj3 merged 1 commit intomainfrom
bugfix/shmipc-unexpected-eof
Mar 19, 2026
Merged

fix(volo-thrift): unexpected UnexpectedEof Err returned by DefaultDec…#647
shenyj3 merged 1 commit intomainfrom
bugfix/shmipc-unexpected-eof

Conversation

@shenyj3
Copy link
Collaborator

@shenyj3 shenyj3 commented Mar 18, 2026

…oder::decode caused by non-standard behavior of shmipc sdk if a connection is closed normally

Motivation

Fix an unexpected UnexpectedEof log in volo-thrift/src/transport/pingpong/server.rs in ShmIPC mode if a ShmIPC connection is closed nomarlly.

The error return chain looks like:

shmipc::Stream::read()
    → read_more() // Return Error::EndOfStream
        → shmipc::compact::StreamExt::poll_read() // e.into() converts to io::Error(UnexpectedEof)
            → volo::BufReader::poll_fill_buf()
                → fill_buf().await? throw UnexpectedEof

Solution

If we can not read even a single byte at the very beginning of DefaultDecoder::decode in ShmIPC mode, which means we will catch a UnexpectedEof Err, it can be regarded as a normal connection close and just return Ok(None) to let volo to do some clean.

@shenyj3 shenyj3 requested review from a team as code owners March 18, 2026 12:34
@codecov
Copy link

codecov bot commented Mar 18, 2026

Codecov Report

❌ Patch coverage is 72.22222% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 43.95%. Comparing base (6e8436c) to head (b5e0aee).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
volo-thrift/src/codec/default/mod.rs 72.22% 20 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #647      +/-   ##
==========================================
+ Coverage   43.68%   43.95%   +0.27%     
==========================================
  Files         161      161              
  Lines       19679    19750      +71     
==========================================
+ Hits         8596     8681      +85     
+ Misses      11083    11069      -14     

☔ 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.

@shenyj3 shenyj3 force-pushed the bugfix/shmipc-unexpected-eof branch from 7d84c05 to a9d220e Compare March 18, 2026 14:26
…oder::decode caused by non-standard behavior of shmipc sdk if a connection is closed normally
@shenyj3 shenyj3 force-pushed the bugfix/shmipc-unexpected-eof branch from a9d220e to b5e0aee Compare March 19, 2026 04:10
@shenyj3 shenyj3 merged commit d9e6751 into main Mar 19, 2026
18 checks passed
@shenyj3 shenyj3 deleted the bugfix/shmipc-unexpected-eof branch March 19, 2026 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants