{"record":{"id":"eaf7c634a9171cea","repo":"lionsoul2014/ip2region","slug":"v6-searcher-pool-already-closed","errorCode":null,"errorMessage":"v6 searcher pool already closed","messagePattern":"v6 searcher pool already closed","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"binding/golang/service/ip2region.go","lineNumber":175,"sourceCode":"\t\treturn \"\", fmt.Errorf(\"v4 searcher pool already closed\")\n\t}\n\tdefer ip2r.v4Pool.ReturnSearcher(v4Searcher)\n\treturn v4Searcher.Search(ipBytes)\n}\n\nfunc (ip2r *Ip2Region) v6Search(ipBytes []byte) (string, error) {\n\tif ip2r.v6InMemSearcher != nil {\n\t\treturn ip2r.v6InMemSearcher.Search(ipBytes)\n\t}\n\n\t// v6 search is disabled\n\tif ip2r.v6Pool == nil {\n\t\treturn \"\", nil\n\t}\n\n\tv6Searcher := ip2r.v6Pool.BorrowSearcher()\n\tif v6Searcher == nil {\n\t\treturn \"\", fmt.Errorf(\"v6 searcher pool already closed\")\n\t}\n\tdefer ip2r.v6Pool.ReturnSearcher(v6Searcher)\n\treturn v6Searcher.Search(ipBytes)\n}\n\nfunc (ip2r *Ip2Region) Close() {\n\tip2r.CloseTimeout(time.Second * 10)\n}\n\nfunc (ip2r *Ip2Region) CloseTimeout(d time.Duration) {\n\tif ip2r.v4Pool != nil {\n\t\tip2r.v4Pool.CloseTimeout(d)\n\t}\n\n\tif ip2r.v6Pool != nil {\n\t\tip2r.v6Pool.CloseTimeout(d)\n\t}\n}","sourceCodeStart":157,"sourceCodeEnd":193,"githubUrl":"https://github.com/lionsoul2014/ip2region/blob/c1a1fc7d5941760db3f8431dc05c48cf7f0e30a1/binding/golang/service/ip2region.go#L157-L193","documentation":"Go service lifecycle error: v6Search could not borrow a searcher because the v6 pool has been closed; identical mechanism to the v4 twin — BorrowSearcher returns nil once Close has run.","triggerScenarios":"Thrown at binding/golang/service/ip2region.go:175 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Recreate the Ip2Region service if you need to search again after Close","Coordinate shutdown so no search races with Close","Treat this sentinel as a signal to rebuild the service"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c1a1fc7d5941760db3f8431dc05c48cf7f0e30a1","analyzedAt":"2026-09-02T16:58:39.988Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T21:17:11.164Z"}