{"record":{"id":"61e405bd712afbf7","repo":"apache/beam","slug":"retryable-failure","errorCode":null,"errorMessage":"Retryable failure","messagePattern":"Retryable failure","errorType":"exception","errorClass":"TransientKinesisException","httpStatus":null,"severity":"warning","filePath":"sdks/java/io/amazon-web-services2/src/main/java/org/apache/beam/sdk/io/aws2/kinesis/SimplifiedKinesisClient.java","lineNumber":237,"sourceCode":"   * @throws RuntimeException - in all other cases\n   */\n  private static <T> T wrapExceptions(Callable<T> callable) throws TransientKinesisException {\n    try {\n      return callable.call();\n    } catch (ExpiredIteratorException e) {\n      throw e;\n    } catch (LimitExceededException | ProvisionedThroughputExceededException e) {\n      throw new KinesisClientThrottledException(\n          \"Too many requests to Kinesis. Wait some time and retry.\", e);\n    } catch (SdkServiceException e) {\n      if (e.isThrottlingException()\n          || SdkDefaultRetrySetting.RETRYABLE_STATUS_CODES.contains(e.statusCode())) {\n        throw new TransientKinesisException(\"Kinesis backend failed. Wait some time and retry.\", e);\n      }\n      throw e; // others, such as 4xx, are not retryable\n    } catch (SdkClientException e) {\n      if (SdkDefaultRetrySetting.RETRYABLE_EXCEPTIONS.contains(e.getClass())) {\n        throw new TransientKinesisException(\"Retryable failure\", e);\n      }\n      throw e;\n    } catch (Exception e) {\n      throw new RuntimeException(\"Unknown kinesis failure, when trying to reach kinesis\", e);\n    }\n  }\n\n  @Override\n  public void close() throws Exception {\n    try (AutoCloseable c1 = kinesis;\n        AutoCloseable c2 = cloudWatch) {\n      // nothing to do\n    }\n  }\n\n  /** Memoizing supplier that closes resources appropriately. */\n  private static class LazyResource<T extends AutoCloseable> implements Supplier<T>, AutoCloseable {\n    private final Supplier<T> initializer;","sourceCodeStart":219,"sourceCodeEnd":255,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/amazon-web-services2/src/main/java/org/apache/beam/sdk/io/aws2/kinesis/SimplifiedKinesisClient.java#L219-L255","documentation":"wrapExceptions catches SdkClientException and, if the exception class is in SdkDefaultRetrySetting.RETRYABLE_EXCEPTIONS (client-side failures the AWS SDK deems retryable, e.g. connection resets, IO interruptions), wraps it in TransientKinesisException with the message 'Retryable failure'. It means the request never succeeded at the HTTP layer, not that Kinesis returned an error.","triggerScenarios":"A Kinesis API call from getShardIterator/listShardsFollowingClosedShard/getRecords/getBacklogBytes fails client-side with a retryable SdkClientException subclass such as IOException-based connection failures or interrupted requests.","commonSituations":"Network flakiness between the job and AWS; DNS resolution hiccups; worker network interruptions in a cluster environment; proxy/firewall dropping connections mid-request.","solutions":["Retry with backoff — the wrapper deliberately marks this as transient.","Check network connectivity and DNS from the job environment to the Kinesis endpoint.","Configure the AWS SDK client with retry policy and increased timeouts for unstable networks."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"catch (TransientKinesisException e) {\n  // retryable client-side/network failure: retry with backoff\n}","preventionTips":["Harden network paths to AWS endpoints (DNS, proxy stability)","Increase client connect/socket timeouts on unstable networks"],"tags":["kinesis","network","transient-error","retry"],"backgroundTag":"network-request-failed","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T21:17:11.552Z"}