Skip to content

Commit 11b0e5c

Browse files
Ron Hemeta-codesync[bot]
authored andcommitted
Fix log location for async logger
Summary: As titled. The log should be in the if-block when log size is larger than current write buffer. Differential Revision: D85835819 fbshipit-source-id: ba7b40b2cd18839b92a1d94e9de9b93ad553d775
1 parent cac4d87 commit 11b0e5c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fboss/agent/AsyncLoggerBase.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ void AsyncLoggerBase::appendLog(const char* logRecord, size_t logSize) {
145145

146146
// Acquire the lock and check if there's enough space in the buffer
147147
latch_.lock();
148-
// Release the lock and notify worker thread to flush logs
149148
if (logSize + getOffset() >= bufferSize_) {
149+
// Release the lock and notify worker thread to flush logs
150150
fullFlush_ = true;
151151
latch_.unlock();
152152
cv_.notify_one();

0 commit comments

Comments
 (0)