-
Notifications
You must be signed in to change notification settings - Fork 38
Open
Labels
HacktoberfestHacktoberfest 2021Hacktoberfest 2021
Description
Situation
Currently on concurrency modification exceptions the sync retries with no limit until there is no error. See:
commercetools-sync-java/src/main/java/com/commercetools/sync/commons/BaseSync.java
Lines 115 to 124 in 7cacc37
| protected static <S> S executeSupplierIfConcurrentModificationException( | |
| @Nonnull final Throwable sphereException, | |
| @Nonnull final Supplier<S> onConcurrentModificationSupplier, | |
| @Nonnull final Supplier<S> onOtherExceptionSupplier) { | |
| final Throwable completionExceptionCause = sphereException.getCause(); | |
| if (completionExceptionCause instanceof ConcurrentModificationException) { | |
| return onConcurrentModificationSupplier.get(); | |
| } | |
| return onOtherExceptionSupplier.get(); | |
| } |
Complication
It causes unnecessary api calls if the platform returns 409 - ConcurrentModificationException for the requests.
Resolution
Limit the number of retries on concurrency modification exceptions.
Metadata
Metadata
Assignees
Labels
HacktoberfestHacktoberfest 2021Hacktoberfest 2021