dlmarion commented on code in PR #2967:
URL: https://github.com/apache/accumulo/pull/2967#discussion_r990213821
##########
core/src/main/java/org/apache/accumulo/core/clientImpl/InstanceOperationsImpl.java:
##########
@@ -119,6 +127,38 @@ public void modifyProperties(final
Consumer<Map<String,String>> mapMutator)
// Send to server
ThriftClientTypes.MANAGER.executeVoid(context, client -> client
.modifySystemProperties(TraceUtil.traceInfo(), context.rpcCreds(),
vProperties));
+
+ return vProperties.getProperties();
+ }
+
+ @Override
+ public Map<String,String> modifyProperties(final
Consumer<Map<String,String>> mapMutator)
+ throws AccumuloException, AccumuloSecurityException,
IllegalArgumentException {
+
+ var log = LoggerFactory.getLogger(InstanceOperationsImpl.class);
+
+ Retry retry =
+ Retry.builder().infiniteRetries().retryAfter(25,
MILLISECONDS).incrementBy(25, MILLISECONDS)
+ .maxWait(30, SECONDS).backOffFactor(1.5).logInterval(3,
MINUTES).createRetry();
+
+ while (true) {
+ try {
+ var props = tryToModifyProperties(mapMutator);
+ retry.logCompletion(log, "Modifying instance properties");
+ return props;
+ } catch (ConcurrentModificationException cme) {
+ try {
+ retry.logRetry(log,
+ "Unable to modify instance properties for because of concurrent
modification");
+ retry.waitForNextAttempt();
+ } catch (InterruptedException e) {
+ throw new RuntimeException(e);
+ }
+ } finally {
+ retry.useRetry();
Review Comment:
I think this is a case that's similar to `Future.get()` where it throws an
`ExecutionException`. As an example, we could:
1. modify
[RetryableThriftFunction](https://github.com/apache/accumulo/blob/main/server/base/src/main/java/org/apache/accumulo/server/compaction/RetryableThriftFunction.java)
to declare `Exception` rather than `TException'.
2. Then in
[RetryableThrifCall](https://github.com/apache/accumulo/blob/main/server/base/src/main/java/org/apache/accumulo/server/compaction/RetryableThriftCall.java#L106)
catch `Exception`
3. When retries have been exhausted, throw a RetriesExceededException
[here](https://github.com/apache/accumulo/blob/main/server/base/src/main/java/org/apache/accumulo/server/compaction/RetryableThriftCall.java#L118)
when there is no error and throw an ExecutionException when retries have been
exhausted and there is an error.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]