Skip to content

Commit 20b3c43

Browse files
committed
Fix issue where if DataStore.start is called rapidly, an interruption could result in starting sync when it shouldn't
1 parent b06f4bd commit 20b3c43

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

aws-datastore/src/main/java/com/amplifyframework/datastore/syncengine/SubscriptionProcessor.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,9 @@ synchronized void startSubscriptions() throws DataStoreException {
150150
LOG.debug("Waiting for subscriptions to start.");
151151
subscriptionsStarted = latch.abortableAwait(adjustedTimeoutSeconds, TimeUnit.SECONDS);
152152
} catch (InterruptedException exception) {
153-
LOG.warn("Subscription operations were interrupted during setup.");
154-
return;
153+
String errorMessage = "Subscription operations were interrupted during setup.";
154+
LOG.warn(errorMessage);
155+
throw new DataStoreException(errorMessage, "Retry");
155156
}
156157

157158
if (subscriptionsStarted) {

0 commit comments

Comments
 (0)