private void executeFunction(final HAStatus haStatus,
      final FunctionIdentifierType functionIdentifierType,
      final PoolImpl executablePool,
      final Function<Integer> function,
      final ServerFunctionExecutor serverFunctionExecutor,
      final Object args,
      final MemberMappedArgument memberMappedArg,
      final ResultCollector<Integer, Collection<Integer>> resultCollector,
      final UserAttributes userAttributes, final String[] groups) {

    switch (functionIdentifierType) {
      case STRING:
        ignoreServerConnectivityException(
            () -> ExecuteFunctionOp.execute(executablePool,
                ALL_SERVERS_SETTING, resultCollector,
                testSupport.toBoolean(haStatus),
                userAttributes, groups,
                new ExecuteFunctionOp.ExecuteFunctionOpImpl(FUNCTION_NAME, args, memberMappedArg,
                    FUNCTION_HAS_RESULT,
                    resultCollector, IS_FN_SERIALIZATION_REQUIRED, testSupport.toBoolean(haStatus),
                    OPTIMIZE_FOR_WRITE_SETTING, (byte) 0, groups, ALL_SERVERS_SETTING,
                    serverFunctionExecutor.isIgnoreDepartedMembers(),
                    DEFAULT_CLIENT_FUNCTION_TIMEOUT),
                () -> new ExecuteFunctionOp.ExecuteFunctionOpImpl(FUNCTION_NAME, args,
                    memberMappedArg, FUNCTION_HAS_RESULT,
                    resultCollector, IS_FN_SERIALIZATION_REQUIRED, testSupport.toBoolean(haStatus),
                    OPTIMIZE_FOR_WRITE_SETTING, (byte) 0,
                    null/* onGroups does not use single-hop for now */, false, false,
                    DEFAULT_CLIENT_FUNCTION_TIMEOUT),
                () -> new ExecuteFunctionOp.ExecuteFunctionOpImpl(FUNCTION_NAME, args,
                    serverFunctionExecutor.getMemberMappedArgument(),
                    FUNCTION_HAS_RESULT, resultCollector, IS_FN_SERIALIZATION_REQUIRED,
                    testSupport.toBoolean(haStatus), OPTIMIZE_FOR_WRITE_SETTING, (byte) 1,
                    groups, ALL_SERVERS_SETTING, serverFunctionExecutor.isIgnoreDepartedMembers(),
                    DEFAULT_CLIENT_FUNCTION_TIMEOUT)));
        break;

      case OBJECT_REFERENCE:
        ignoreServerConnectivityException(
            () -> ExecuteFunctionOp.execute(executablePool,
                ALL_SERVERS_SETTING, resultCollector,
                function.isHA(), userAttributes, groups,
                new ExecuteFunctionOp.ExecuteFunctionOpImpl(function, args, memberMappedArg,
                    resultCollector,
                    IS_FN_SERIALIZATION_REQUIRED, (byte) 0, groups, ALL_SERVERS_SETTING,
                    serverFunctionExecutor
                        .isIgnoreDepartedMembers(),
                    DEFAULT_CLIENT_FUNCTION_TIMEOUT),
                () -> new ExecuteFunctionOp.ExecuteFunctionOpImpl(function, args, memberMappedArg,
                    resultCollector, IS_FN_SERIALIZATION_REQUIRED, (byte) 0,
                    null/* onGroups does not use single-hop for now */,
                    false, false, DEFAULT_CLIENT_FUNCTION_TIMEOUT),
                () -> new ExecuteFunctionOp.ExecuteFunctionOpImpl(function,
                    serverFunctionExecutor.getArguments(),
                    serverFunctionExecutor.getMemberMappedArgument(),
                    resultCollector,
                    IS_FN_SERIALIZATION_REQUIRED, (byte) 1, groups, ALL_SERVERS_SETTING,
                    serverFunctionExecutor.isIgnoreDepartedMembers(),
                    DEFAULT_CLIENT_FUNCTION_TIMEOUT)));
        break;
      default:
        throw new AssertionError("unknown FunctionIdentifierType type: " + functionIdentifierType);
    }

  }
Test retry counts for onServer() function execution (via ExecuteFunctionOp).
Convince ourselves they aren't going to ever be infinite!
geode-core/src/test/java/org/apache/geode/cache/client/internal/ExecuteFunctionOpRetryTest.java