{"record":{"id":"d4e78c72dc1bd5da","repo":"nats-io/nats-server","slug":"updateconfig-took-v","errorCode":null,"errorMessage":"UpdateConfig took %v","messagePattern":"UpdateConfig took (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/filestore.go","lineNumber":729,"sourceCode":"\t// First enable sync after every write, so that any inflight\n\t// or subsequent write gets synced\n\tfs.updateDurabilitySettingsLocked(1)\n\tfs.mu.Unlock()\n\n\t// Sync all dirty blocks, so that we no longer have to rely\n\t// on the backing Raft WAL.\n\tfs.syncBlocks()\n\n\tfs.mu.RLock()\n\tdefer fs.mu.RUnlock()\n\treturn fs.werr\n}\n\nfunc (fs *fileStore) UpdateConfig(cfg *StreamConfig) error {\n\tstart := time.Now()\n\tdefer func() {\n\t\tif took := time.Since(start); took > time.Minute {\n\t\t\tfs.warn(\"UpdateConfig took %v\", took.Round(time.Millisecond))\n\t\t}\n\t}()\n\n\tif fs.isClosed() {\n\t\treturn ErrStoreClosed\n\t}\n\tif cfg.Name == _EMPTY_ {\n\t\treturn fmt.Errorf(\"name required\")\n\t}\n\tif cfg.Storage != FileStorage {\n\t\treturn fmt.Errorf(\"fileStore requires file storage type in config\")\n\t}\n\tif cfg.MaxMsgsPer < -1 {\n\t\tcfg.MaxMsgsPer = -1\n\t}\n\n\tfs.mu.Lock()\n\tnew_cfg := FileStreamInfo{Created: fs.cfg.Created, StreamConfig: *cfg}","sourceCodeStart":711,"sourceCodeEnd":747,"githubUrl":"https://github.com/nats-io/nats-server/blob/3a66a489d262bf89b71a71c955c94920394532f3/server/filestore.go#L711-L747","documentation":"A performance watchdog, not an error: fileStore.UpdateConfig took longer than 1 minute (logged via warn). Config updates lock the store and can trigger expensive limit enforcement/rebuilds, so this signals the operation is slow enough to matter for availability.","triggerScenarios":"Thrown at server/filestore.go:729 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reduce stream size or excessive limits (max msgs/bytes/subjects) that make enforcement slow","Schedule config changes off-peak on very large streams","Capture pprof profile during an update if the cause is unclear"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3a66a489d262bf89b71a71c955c94920394532f3","analyzedAt":"2026-09-02T04:41:54.247Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}