diff --git a/CLAUDE.md b/CLAUDE.md index b1796926..3fb1b148 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -9,7 +9,7 @@ This is a Maven monorepo containing the PDS (Planetary Data System) Registry Loa **Key characteristics:** - Maven multi-module Java project (modules: `common`, `harvest`, `manager`) - Parent version: 1.3.0-SNAPSHOT -- Depends on `registry-common` library for shared OpenSearch/Elasticsearch abstractions +- **Hard fork / merge of three upstream repos:** The source code in this monorepo was merged from [`registry-common`](https://github.com/NASA-PDS/registry-common), [`harvest`](https://github.com/NASA-PDS/harvest), and [`registry-manager`](https://github.com/NASA-PDS/registry-manager). There is **no active dependency on those upstream repos** — they are separate projects. Bug fixes or changes made in those upstream repos must be **manually ported** into this codebase. Always check upstream PRs/issues when triaging bugs here. ## Modules diff --git a/common/src/main/java/gov/nasa/pds/registry/common/connection/aws/RestClientWrapper.java b/common/src/main/java/gov/nasa/pds/registry/common/connection/aws/RestClientWrapper.java index 127aa8a3..3aad50df 100644 --- a/common/src/main/java/gov/nasa/pds/registry/common/connection/aws/RestClientWrapper.java +++ b/common/src/main/java/gov/nasa/pds/registry/common/connection/aws/RestClientWrapper.java @@ -78,6 +78,24 @@ public R retry (T arg) throws IOException, ResponseException { throw ose; } } + catch (IOException ioe) { + retries++; + if (retries < retry_limit) { + log.warn("Transient I/O error communicating with OpenSearch ({}). Rebuilding connection and retrying ({}/{})...", + ioe, retries, retry_limit); + try { conFact.reconnect(); } + catch (InterruptedException ie) { throw new RuntimeException("How did this happen??", ie); } + client = buildClient(); + try { + Thread.sleep(Math.min(retries, 30) * 1000L); + } catch (InterruptedException ie) { + Thread.currentThread().interrupt(); + } + } else { + log.error("Tried {} times to recover from I/O errors with OpenSearch but cannot.", retry_limit, ioe); + throw ioe; + } + } } } }