YARN-6376. Exceptions caused by synchronous putEntities requests can be swallowed (Haibo Chen via Varun Saxena)
This commit is contained in:
parent
7c2bc444b3
commit
b58777a9c9
|
@ -137,8 +137,14 @@ public abstract class TimelineCollector extends CompositeService {
|
|||
+ 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 class TimelineCollectorManager extends AbstractService {
|
|||
|
||||
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…
Reference in New Issue