{"record":{"id":"8af01acf17660e35","repo":"juicedata/juicefs","slug":"aborted-8af01a","errorCode":null,"errorMessage":"aborted","messagePattern":"aborted","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"info","filePath":"pkg/sync/sync.go","lineNumber":476,"sourceCode":"\tif !fi.IsSymlink() || !config.Links {\n\t\t// chmod needs to be executed after chown, because chown will change setuid setgid to be invalid.\n\t\tif err := dst.(object.FileSystem).Chown(key, fi.Owner(), fi.Group()); err != nil {\n\t\t\tlogger.Warnf(\"Chown %s to (%s,%s): %s\", key, fi.Owner(), fi.Group(), err)\n\t\t}\n\t\tif err := dst.(object.FileSystem).Chmod(key, fi.Mode()); err != nil {\n\t\t\tlogger.Warnf(\"Chmod %s to %o: %s\", key, fi.Mode(), err)\n\t\t}\n\t}\n\tlogger.Debugf(\"Copied permissions (%s:%s:%s) for %s in %s\", fi.Owner(), fi.Group(), fi.Mode(), key, time.Since(start))\n}\n\nfunc calPartChksum(objStor object.ObjectStorage, key string, abort chan struct{}, offset, length int64) (uint32, error) {\n\tif limiter != nil {\n\t\tlimiter.Wait(length)\n\t}\n\tselect {\n\tcase <-abort:\n\t\treturn 0, fmt.Errorf(\"aborted\")\n\tcase concurrent <- 1:\n\t\tdefer func() {\n\t\t\t<-concurrent\n\t\t}()\n\t}\n\tin, err := objStor.Get(ctx, key, offset, length)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"dest get: %s\", err)\n\t}\n\tdefer in.Close()\n\n\tbuf := bufPool.Get().(*[]byte)\n\tdefer bufPool.Put(buf)\n\tvar chksum uint32\n\tfor left := int(length); left > 0; left -= bufferSize {\n\t\tbs := bufferSize\n\t\tif left < bufferSize {\n\t\t\tbs = left","sourceCodeStart":458,"sourceCodeEnd":494,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/pkg/sync/sync.go#L458-L494","documentation":"calPartChksum computes the CRC32 of a remote object part during sync comparison. Before doing work it selects on the abort channel; if the abort channel is closed (sync is being cancelled) it returns 'aborted'. This is a cooperative-cancellation error, not a malfunction.","triggerScenarios":"The sync's abort channel is closed (Ctrl-C, another goroutine detected a fatal error, or check-and-copy decided the comparison is moot) while calPartChksum is about to read a part; also triggered if abort fires between limiter.Wait and acquiring the concurrency slot.","commonSituations":"User interrupts a sync mid-checksum; a parallel worker failed causing global cancellation; shutdown of the process during large-file comparison.","solutions":["No fix needed — this is expected during cancellation; treat it as a cancellation signal, not a failure","If seen without user interruption, check logs above for the original error that triggered abort","Re-run the sync to complete the checksum comparison"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"chksum, err := calPartChksum(stor, key, abort, off, length)\nif err != nil {\n\tif err.Error() == \"aborted\" {\n\t\treturn nil // expected cancellation, not a failure\n\t}\n\treturn fmt.Errorf(\"checksum failed: %s\", err)\n}","preventionTips":["Treat 'aborted' as a control-flow signal and skip reporting it as sync failure","Check earlier logs for the root error that closed the abort channel","Avoid panic-driven aborts so cancellations remain orderly"],"tags":["sync","cancellation","checksum"],"backgroundTag":"operation-cancelled","analyzedSha":"c9a67b23e8e08ec23ec331aa6f1675e2319e921c","analyzedAt":"2026-09-06T17:55:48.476Z","contentChangedAt":"2026-09-06T17:55:48.476Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}