Update Operation might hang (rarely) when retrying on invalid shard state

The retry logic when failing does not reset the operation started flag...
closes #3769
This commit is contained in:
Shay Banon 2013-09-24 13:01:45 +02:00
parent 4f8c20f3fe
commit 4370dfed76
1 changed files with 4 additions and 1 deletions

View File

@ -192,7 +192,10 @@ public abstract class TransportInstanceSingleOperationAction<Request extends Ins
shardOperation(request, listener); shardOperation(request, listener);
} catch (Throwable e) { } catch (Throwable e) {
if (retryOnFailure(e)) { if (retryOnFailure(e)) {
retry(fromClusterEvent, null); operationStarted.set(false);
// we already marked it as started when we executed it (removed the listener) so pass false
// to re-add to the cluster listener
retry(false, null);
} else { } else {
listener.onFailure(e); listener.onFailure(e);
} }