{"record":{"id":"8a972ab55c1e0171","repo":"t8y2/dbx","slug":"strings-join-failures-8a972a","errorCode":null,"errorMessage":"strings.Join(failures, \"; \")","messagePattern":"strings\\.Join\\(failures, \"; \"\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"agents/drivers/argo-go/query.go","lineNumber":279,"sourceCode":"\t\treturn false\n\t}\n\tdelete(server.querySessions, sessionID)\n\tstate.cancel()\n\t_ = state.rows.Close()\n\treturn true\n}\n\nfunc (server *server) closeAllQuerySessions() error {\n\tvar failures []string\n\tfor sessionID, state := range server.querySessions {\n\t\tdelete(server.querySessions, sessionID)\n\t\tstate.cancel()\n\t\tif err := state.rows.Close(); err != nil {\n\t\t\tfailures = append(failures, fmt.Sprintf(\"%s: %v\", sessionID, err))\n\t\t}\n\t}\n\tif len(failures) > 0 {\n\t\treturn errors.New(strings.Join(failures, \"; \"))\n\t}\n\treturn nil\n}\n\nfunc (server *server) expireIdleQuerySessions(now time.Time) int {\n\texpired := make([]string, 0)\n\tfor sessionID, state := range server.querySessions {\n\t\tif !state.lastAccessed.IsZero() && now.Sub(state.lastAccessed) >= querySessionIdleTime {\n\t\t\texpired = append(expired, sessionID)\n\t\t}\n\t}\n\tfor _, sessionID := range expired {\n\t\tserver.closeQuerySession(sessionID)\n\t}\n\treturn len(expired)\n}\n\nfunc (server *server) executeStatements(params map[string]json.RawMessage, transaction bool) (queryResult, error) {","sourceCodeStart":261,"sourceCodeEnd":297,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/argo-go/query.go#L261-L297","documentation":"closeAllQuerySessions iterates all open query sessions and closes their rows; if any rows.Close() fails, it aggregates each failure as \"sessionID: err\" and returns them joined with \"; \" as a single error. This is a shutdown-time cleanup error surfaced during disconnect, indicating one or more open result sets could not be closed cleanly.","triggerScenarios":"Calling disconnect while query sessions are open and the underlying driver rows fail to close (e.g. broken connection to the Hive server, already-closed transport, server-side error during close).","commonSituations":"Shutting down a client whose network connection to HiveServer2 dropped; leaking open paged queries and then disconnecting; TLS or firewall interruptions making the close RPC fail.","solutions":["Inspect the joined message to see which session IDs failed and why","Ensure all paged queries are fully drained or explicitly cancelled before disconnect","Treat this as advisory during teardown if the connection is being discarded anyway; reconnect will reset session state","Check network/TLS stability if this occurs routinely at shutdown"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// no pre-call check; ensure sessions are closed before disconnect\nfor id, s := range openSessions {\n    _ = s.close() // close proactively to surface errors early\n}","typeGuard":null,"tryCatchPattern":"if err := client.Disconnect(ctx); err != nil {\n    if strings.Contains(err.Error(), \": \") { // joined session failures\n        log.Warn(\"session close failures during disconnect\", \"detail\", err)\n    }\n}","preventionTips":["Drain or cancel all paged queries before disconnect","Log and continue on teardown errors when the connection is being discarded","Monitor network stability; repeated close failures indicate transport issues"],"tags":["cleanup","resource-leak","network","shutdown","go"],"backgroundTag":"connection-reset","analyzedSha":"c0390bff16418b651f4728520d99adf8ce48829a","analyzedAt":"2026-09-05T23:05:10.900Z","contentChangedAt":"2026-09-05T23:05:10.900Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}