reddycharan opened a new issue #1345: order of flush is not correct in 
entrylogger/entrylogmanager flush call
URL: https://github.com/apache/bookkeeper/issues/1345
 
 
   
   **BUG REPORT**
   
   1. Please describe the issue you observed:
   
   It is incorrect to call flushrotatedlogs first and then flushcurrentlogs in 
the EntryLogger (EntryLogManager) flush method. Consider this scenario - if in 
between flushRotatedLogs, flushCurrentLogs calls in another thread current 
activelog is rotated and added to rotatedlogs list then we would miss flushing 
that log in this current flush call. So it has to be first flushCurrentLogs and 
then flushRotatedLogs.
   
   1) lets say flush method is called
   2) now as per the existing implementation of flush method, flushRotatedLogs 
is called first and following will be executed in the synchronized block - 
where 'logChannelsToFlush' is assigned to 'channels' and null is assigned to 
'logChannelsToFlush'
   3) now lets say in another thread, current active entrylog is rotated 
(because of reaching the size limit) then the current active entrylog will be 
added to new 'logChannelsToFlush' list. 
   4) And when flushCurrentLogs is called it would flush the current active 
entrylog but not the one which is just rotated. 
   
   So we missed flushing the just rotated log in this 
entrylogger/entrylogmanager flush() call, which is not expected.
   
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to