fxconfig: prevent reuse of closed orderer and notification clients across submissions

Aperta
#116 3 commenti 0 reazioni 1 assegnatario Vedi su GitHub

@Kumar-s75 ci sta già lavorando.

Dal 16/4/2026.

  • #153 di @Kumar-s75 — aperta

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

fxconfig

Title: fxconfig: prevent reuse of closed orderer and notification clients across submissions

Problem

fxconfig uses provider.Provider.Get() to lazily initialize and cache service instances with sync.Once.

However, the submission path closes some of the returned clients after use:

  • the orderer client is closed at the end of submission
  • the notification client is also closed in the --wait flow

This creates an ownership mismatch:

  • providers cache these clients as long-lived instances
  • callers treat them as per-operation resources

As a result, repeated operations may reuse a cached client whose underlying connection has already been closed.

Code path

  • tools/fxconfig/internal/provider/provider.go: Provider.Get() memoizes instances using sync.Once
  • tools/fxconfig/internal/app/submit.go: submission closes the orderer client after use
  • tools/fxconfig/internal/app/submit.go: SubmitTransactionWithWait also closes the notification client

Why it matters

This may cause repeated CLI operations in the same application instance to fail unpredictably and makes client lifecycle semantics unclear.

Suggested direction

Choose one ownership model and apply it consistently:

  1. Providers should not cache closeable gRPC clients and should create fresh instances per use, or
  2. Providers should own the lifecycle of cached clients, and consumers should not close provider-managed instances.

Acceptance criteria

  • repeated submit operations work correctly
  • repeated submit-with-wait operations work correctly
  • client ownership semantics are clear in code
  • regression tests cover repeated usage
Lingua principale
Go
Stelle
65
Fork
85
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

  • Include un Dockerfile o un file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di hyperledger/fabric-x

Tutte le issue di hyperledger/fabric-x

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.