File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,9 @@ class FSEditLogAsync extends FSEditLog implements Runnable {
4747 private Thread syncThread ;
4848 private static final ThreadLocal <Edit > THREAD_EDIT = new ThreadLocal <Edit >();
4949
50+ // number of retry times for sending edit log sync response.
51+ private static final int RESPONSE_SEND_RETRIES = 3 ;
52+
5053 // requires concurrent access from caller threads and syncing thread.
5154 private final BlockingQueue <Edit > editPendingQ ;
5255
@@ -378,13 +381,18 @@ public void logSyncWait() {
378381
379382 @ Override
380383 public void logSyncNotify (RuntimeException syncEx ) {
381- try {
382- if (syncEx == null ) {
383- call .sendResponse ();
384- } else {
385- call .abortResponse (syncEx );
384+ for (int retries = 0 ; retries <= RESPONSE_SEND_RETRIES ; retries ++) {
385+ try {
386+ if (syncEx == null ) {
387+ call .sendResponse ();
388+ } else {
389+ call .abortResponse (syncEx );
390+ }
391+ break ;
392+ } catch (Exception e ) {
393+ LOG .info ("Error in sending log sync response, retry " + retries , e );
386394 }
387- } catch ( Exception e ) {} // don't care if not sent.
395+ }
388396 }
389397
390398 @ Override
You can’t perform that action at this time.
0 commit comments