fix(deps): [OCISDEV-834] recover from dead NATS connections in nats-js-kv (stable-8.1)#12402
Merged
kobergj merged 1 commit intoJun 15, 2026
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
…s-kv Bumps the kobergj/plugins nats-js-kv replace pin to fc78af4, which fixes hasConn() to treat a permanently-closed NATS connection as no connection. Previously hasConn() only checked n.conn != nil, so once the client exhausted its reconnect attempts the connection stayed non-nil but dead, initConn() never re-ran, and every KV operation failed with 'nats: connection closed' until the pod was restarted. Backport of owncloud#12401 to stable-8.1. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Julian Koberg <julian.koberg@kiteworks.com>
eb11d93 to
74a4df4
Compare
mzner
approved these changes
Jun 12, 2026
deyankiteworks
approved these changes
Jun 12, 2026
2403905
approved these changes
Jun 12, 2026
mklos-kw
approved these changes
Jun 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #12401 to stable-8.1.
Problem
The
nats-js-kvgo-micro store plugin'shasConn()only checkedn.conn != nil, not whether the connection was still alive. Once the underlying NATS client exhausted its reconnect attempts (e.g. a NATS pod restart longer than the client's reconnect window),n.connstayed non-nil but permanently closed. BecauseinitConn()is gated on!hasConn(), it never re-ran, so every subsequent KV operation failed withnats: connection closeduntil the affected pod was restarted.This is a base-layer bug in the store plugin used by every oCIS service backed by the NATS KV cache. Confirmed BYCS production manifestations:
OPS workaround to date: rolling-restart the affected pod(s).
Fix
This is a dependency bump only. The
replacedirective forgithub.com/go-micro/plugins/v4/store/nats-js-kvis pointed atkobergj/pluginscommitfc78af4, whosehasConn()now treats a closed connection as no connection:so the next operation transparently re-initializes the connection. (See go-micro/plugins#142 for the upstream change.)
No oCIS source changes — only
go.mod,go.sum, the re-vendored plugin, and a changelog entry.Scope note
This backport is intentionally minimal: it ships only the plugin fix, which is the load-bearing change that lets the system self-heal. The complementary hardening discussed in OCISDEV-834 (proactive
MaxReconnect=-1+ connection-state handlers in reva'spkg/storeand oCIS'snatsjsregistry) lands on master only, not on this stable branch.Refs OCISDEV-834.