YARN-6376. Exceptions caused by synchronous putEntities requests can be swallowed (Haibo Chen via Varun Saxena)
(cherry picked from commit b58777a9c9a5b6f2e4bcfd2b3bede33f25f80dec)
This commit is contained in:
parent
debe526f08
commit
fd88fa8083
@ -137,8 +137,14 @@ public TimelineWriteResponse putEntities(TimelineEntities entities,
|
||||
+ callerUgi + ")");
|
||||
}
|
||||
|
||||
TimelineWriteResponse response = writeTimelineEntities(entities);
|
||||
flushBufferedTimelineEntities();
|
||||
TimelineWriteResponse response;
|
||||
// synchronize on the writer object so that no other threads can
|
||||
// flush the writer buffer concurrently and swallow any exception
|
||||
// caused by the timeline enitites that are being put here.
|
||||
synchronized (writer) {
|
||||
response = writeTimelineEntities(entities);
|
||||
flushBufferedTimelineEntities();
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
|
@ -259,7 +259,12 @@ public WriterFlushTask(TimelineWriter writer) {
|
||||
|
||||
public void run() {
|
||||
try {
|
||||
writer.flush();
|
||||
// synchronize on the writer object to avoid flushing timeline
|
||||
// entities placed on the buffer by synchronous putEntities
|
||||
// requests.
|
||||
synchronized (writer) {
|
||||
writer.flush();
|
||||
}
|
||||
} catch (Throwable th) {
|
||||
// we need to handle all exceptions or subsequent execution may be
|
||||
// suppressed
|
||||
|
Loading…
x
Reference in New Issue
Block a user