{"record":{"id":"58c3904be0bc6d6b","repo":"XTLS/Xray-core","slug":"failed-to-close-all-resources-58c390","errorCode":null,"errorMessage":"failed to close all resources","messagePattern":"failed to close all resources","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/proxyman/inbound/worker.go","lineNumber":162,"sourceCode":"\tif err != nil {\n\t\treturn errors.New(\"failed to listen TCP on \", w.port).AtWarning().Base(err)\n\t}\n\tw.hub = hub\n\treturn nil\n}\n\nfunc (w *tcpWorker) Close() error {\n\tvar errs []interface{}\n\tif w.hub != nil {\n\t\tif err := common.Close(w.hub); err != nil {\n\t\t\terrs = append(errs, err)\n\t\t}\n\t\tif err := common.Close(w.proxy); err != nil {\n\t\t\terrs = append(errs, err)\n\t\t}\n\t}\n\tif len(errs) > 0 {\n\t\treturn errors.New(\"failed to close all resources\").Base(errors.New(serial.Concat(errs...)))\n\t}\n\n\treturn nil\n}\n\nfunc (w *tcpWorker) Port() net.Port {\n\treturn w.port\n}\n\ntype udpConn struct {\n\tlastActivityTime int64 // in seconds\n\treader           buf.Reader\n\twriter           buf.Writer\n\toutput           func([]byte) (int, error)\n\tremote           net.Addr\n\tlocal            net.Addr\n\tdone             *done.Instance\n\tuplink           stats.Counter","sourceCodeStart":144,"sourceCodeEnd":180,"githubUrl":"https://github.com/XTLS/Xray-core/blob/7d214f8b094f75322fa3990f8aadad1c912f24f5/app/proxyman/inbound/worker.go#L144-L180","documentation":"Error \"failed to close all resources\" thrown in XTLS/Xray-core.","triggerScenarios":"Thrown at app/proxyman/inbound/worker.go:162 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7d214f8b094f75322fa3990f8aadad1c912f24f5","analyzedAt":"2026-08-15T14:26:24.325Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}