-
Notifications
You must be signed in to change notification settings - Fork 103
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 send buffer (log shipping) out of range panic #2080
base: main
Are you sure you want to change the base?
fix send buffer (log shipping) out of range panic #2080
Conversation
@@ -30,6 +30,9 @@ type SendBuffer struct { | |||
sender sender | |||
sendTicker *time.Ticker | |||
isSending bool | |||
|
|||
// logsJustPurged is used to prevent attempting to delete logs that were just purged | |||
logsJustPurged bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this safe as bool and not atomic.Bool because we think it's adequately protected by the writeMutex? (it seems like it at first glance just wanted to double check)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, it's protected by the writeMutex... trying to think of a better way to do this, but I think this will suffice
fixes panic: runtime error: index out of range [x] with length x that can occur in sendBuffer if buffer gets purged while waiting on network call to ship logs