Skip to content

Commit

Permalink
fix: Correct premature file read termination triggered by sender back…
Browse files Browse the repository at this point in the history
… pressure (#1251)

Resolved an issue where incomplete file reads were occurring as a result of
reader flush timeout events overwriting blocked events. This fix
ensures that blocked events maintain priority, allowing files to be read fully.
  • Loading branch information
linrunqi08 authored and yyuuttaaoo committed Dec 7, 2023
1 parent 4bfdccd commit aa19eb4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion core/event/BlockEventManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,14 @@ class BlockedEventManager : public LogstoreFeedBackInterface {
BlockedEvent() : mLogstoreKey(0), mEvent(NULL), mInvalidTime(time(NULL)), mTimeout(1) {}
void Update(const LogstoreFeedBackKey& logstoreKey, Event* pEvent, int32_t curTime) {
if (mEvent != NULL) {
delete mEvent;
// There are only two situations where event coverage is possible
// 1. the new event is not timeout event
// 2. old event is timeout event
if (!pEvent->IsReaderFlushTimeout() || mEvent->IsReaderFlushTimeout()) {
delete mEvent;
} else {
return;
}
}
mEvent = pEvent;
mLogstoreKey = logstoreKey;
Expand Down

0 comments on commit aa19eb4

Please sign in to comment.