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

fix: prevent panic on partial append failures #977

Merged
merged 1 commit into from
Jan 31, 2025

Conversation

kakao-mark-yun
Copy link
Contributor

What this PR does

This PR prevents client-side panics in append error handling by correctly accessing error messages from the result struct instead of a nil error variable during partial append failures.

Anything else

Couldn't find a clean way to simulate partial failures on a specific log stream in the test environment, so test coverage was not added for this fix.

During partial append failures, the error field was incorrectly accessed
from a nil err variable instead of the result struct, causing a nil
pointer dereference panic.

Change err.Error() to res[idx].Error to properly handle error messages
in partial failure cases.
@CLAassistant
Copy link

CLAassistant commented Jan 31, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@ijsong ijsong left a comment

Choose a reason for hiding this comment

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

@kakao-mark-yun, Thank you for your contribution!

Copy link

codecov bot commented Jan 31, 2025

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 78.93%. Comparing base (ddbd14f) to head (c8f2e96).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pkg/varlog/operations.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #977      +/-   ##
==========================================
+ Coverage   78.86%   78.93%   +0.07%     
==========================================
  Files         180      180              
  Lines       21621    21621              
==========================================
+ Hits        17051    17067      +16     
+ Misses       3742     3736       -6     
+ Partials      828      818      -10     

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

@ijsong ijsong merged commit b6fb11e into kakao:main Jan 31, 2025
10 checks passed
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.

3 participants