From 04ad5b84bb913d2b6579aa650d408ff3fb5eea8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Fri, 25 Sep 2026 15:47:47 +0200 Subject: [PATCH] fix(storage-users): keep uploads sessions CLI out of the dcfs event queue The uploads sessions command builds a posix driver with async file uploads enabled, which makes it join the "dcfs" JetStream queue group. Clean/restart/resume events published by the command itself can then be routed to the CLI's own short-lived consumer; the nats client auto-acks them and they are lost when the process exits, leaving stale upload sessions behind. Disable asyncfileuploads for the CLI driver instance so it only lists sessions and publishes events. Also emit [] instead of null when the session list is empty so the JSON output stays parseable. --- services/storage-users/pkg/command/uploads.go | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/services/storage-users/pkg/command/uploads.go b/services/storage-users/pkg/command/uploads.go index d2e89d3b67..3c320d925f 100644 --- a/services/storage-users/pkg/command/uploads.go +++ b/services/storage-users/pkg/command/uploads.go @@ -75,7 +75,14 @@ func ListUploadSessions(cfg *config.Config) *cobra.Command { var fsStream events.Stream if cfg.Driver == "posix" { // We need to init the posix driver with 'scanfs' disabled - drivers["posix"] = revaconfig.Posix(cfg, false, false) + posixDrivers := revaconfig.Posix(cfg, false, false) + // Disable async file uploads: this command only lists sessions and publishes + // events, but with async uploads enabled the driver would join the "dcfs" + // JetStream queue group. Events routed to this short-lived CLI member are + // auto-acked by the nats client and lost when the process exits, so the + // clean/restart/resume events published below would never reach the daemon. + posixDrivers["asyncfileuploads"] = false + drivers["posix"] = posixDrivers // Also posix refuses to start without an events stream fsStream, err = event.NewStream(cfg) if err != nil { @@ -116,10 +123,8 @@ func ListUploadSessions(cfg *config.Config) *cobra.Command { return err } - var ( - table *tablewriter.Table - raw []*Session - ) + var table *tablewriter.Table + raw := []*Session{} if !renderJson { fmt.Println(buildInfo(filter))