Skip to content

fix(net): preserve errno status for receive failures - #27

Merged
thweetkomputer merged 3 commits into
mainfrom
fix/recv-error-status
Nov 2, 2026
Merged

thweetkomputer merged 3 commits into
mainfrom
fix/recv-error-status

Conversation

@thweetkomputer

@thweetkomputer thweetkomputer commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

A TCP reset currently arrives from io_uring as -ECONNRESET, but the receive completion handler replaces it with kUnknown and discards the errno diagnostic. Consumers such as Lavik consequently cannot distinguish an unavailable connection from an unclassified failure.

Use absl::ErrnoToStatus in the shared one-shot/multishot receive error path. Connection resets and aborts become kUnavailable; other receive errors retain their errno-derived classification and diagnostic message. Orderly EOF remains a successful zero-byte read. Existing cancellation and buffer-exhaustion handling is unchanged, and successful receive processing adds no fields or branches.

Add live loopback FIN/RST regressions for ordinary and buffered reads under default and forced one-shot configurations. Read selection uses separate branch-local awaits so GCC 13 propagates the error result correctly.

Validation (run from the Lavik checkout with LAVIK_BYCORF_SOURCE_DIR pointing to this Bycorf worktree):

  • build_ci/bycorf/bycorf_runtime_tests --gtest_filter=TcpBufferedRead.*PeerCloseStatus: both new regressions failed against the original receive handler.
  • build_ci/bycorf/bycorf_runtime_tests: all 30 tests passed with Clang 18.
  • /tmp/lavik-metrics-bycorf-gcc/bycorf_runtime_tests: all 30 tests passed with GCC 13 Debug. The two new tests reproduced the CI failures locally before replacing the conditional-expression awaits with explicit branches.
  • pre-commit run --files src/io/io_uring_backend.cpp include/bycorf/net/tcp_stream.h tests/tcp_buffered_read_test.cpp docs/architecture/networking.md (Bycorf root): passed.
  • git diff --check: passed.

The local host rejected provided-buffer-ring setup, so the default configuration fell back to one-shot receives. Actual multishot operation and DPDK/TLS were not separately exercised.

Companion consumer PR: eloqdata/lavik#414.

@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5de52616-ff1d-4c6b-8d06-53a1cb0e7b88
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@thweetkomputer
thweetkomputer merged commit a430b32 into main Nov 2, 2026
10 checks passed
@thweetkomputer
thweetkomputer deleted the fix/recv-error-status branch November 2, 2026 10:31
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