{"record":{"id":"95230636fd77bdaa","repo":"apache/beam","slug":"attempt-of-failed","errorCode":null,"errorMessage":"Attempt #{} of {} failed","messagePattern":"Attempt #(.+?) of (.+?) failed","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/java/io/common/src/main/java/org/apache/beam/sdk/io/common/IOITHelper.java","lineNumber":89,"sourceCode":"   * an exception is thrown and it does not depend on the error response. This can be used for tests\n   * which await for infrastructure setup i.e. database connection.\n   *\n   * @param maxAttempts The number of retry attempts\n   * @param minDelay Minimal delay which will grow exponentially\n   * @param function The function to retry\n   * @throws Exception\n   */\n  public static void executeWithRetry(int maxAttempts, long minDelay, RetryFunction function)\n      throws Exception {\n    int attempts = 1;\n    long delay = minDelay;\n\n    while (attempts <= maxAttempts) {\n      try {\n        function.run();\n        return;\n      } catch (Exception e) {\n        LOG.warn(\"Attempt #{} of {} failed\", attempts, maxAttempts, e);\n        if (attempts == maxAttempts) {\n          throw e;\n        } else {\n          long nextDelay = (long) Math.pow(2, attempts) * delay;\n          LOG.warn(\"Retrying in {} ms.\", nextDelay);\n          Thread.sleep(nextDelay);\n        }\n        attempts++;\n      }\n    }\n  }\n}\n","sourceCodeStart":71,"sourceCodeEnd":102,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/common/src/main/java/org/apache/beam/sdk/io/common/IOITHelper.java#L71-L102","documentation":"WARN logged by IOITHelper.executeWithRetry when an invocation of the wrapped function throws and attempts remain. It is part of an exponential-backoff retry loop for integration-test infrastructure setup (e.g. waiting for a database to accept connections); the exception is attached to the log so the transient failure cause is visible while retrying continues.","triggerScenarios":"Thrown at sdks/java/io/common/src/main/java/org/apache/beam/sdk/io/common/IOITHelper.java:89 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Transient infra failures: rely on the retry loop with sufficient maxAttempts and minDelay","If failures persist, fix the underlying infrastructure issue (service not up, wrong credentials)"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}