Browse code

[mapi] BM-15016 Fix: catch folder deletion timeout

David Phan authored on 04/07/2019 07:07:30
Showing 1 changed files
... ...
@@ -210,11 +210,17 @@ public class ImapReplicatedMailboxesService extends BaseReplicatedMailboxesServi
210 210
 		}
211 211
 		CompletableFuture<ItemIdentifier> future = ReplicationEvents.onSubtreeUpdate(toWatch);
212 212
 		final String fnName = newName;
213
+		final String fnToWath = toWatch;
213 214
 		imapContext.withImapClient((sc, fast) -> {
214 215
 			logger.info("Deleting {}", fnName);
215 216
 			selectInbox(sc, fast);
216 217
 			sc.deleteMailbox(fnName);
217
-			return future.get(10, TimeUnit.SECONDS);
218
+			try {
219
+				return future.get(10, TimeUnit.SECONDS);
220
+			} catch (InterruptedException | ExecutionException | TimeoutException e) {
221
+				logger.warn("Failed to delete folder {} {}", fnName, fnToWath);
222
+				throw new ServerFault(e);
223
+			}
218 224
 		});
219 225
 	}
220 226