{"record":{"id":"7611c89d436bd3ac","repo":"JuliusBrussee/caveman","slug":"native-runtime-named-pipe-accept-w","errorCode":null,"errorMessage":"native runtime named-pipe accept: %w","messagePattern":"native runtime named-pipe accept: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"proxy/internal/nativeruntime/server_windows.go","lineNumber":68,"sourceCode":"\t\tSecurityDescriptor: sddl,\n\t\tInputBufferSize:    maxRequestBytes,\n\t\tOutputBufferSize:   maxRequestBytes,\n\t})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"native runtime named-pipe listen: %w\", err)\n\t}\n\tdefer listener.Close()\n\tgo func() {\n\t\t<-ctx.Done()\n\t\t_ = listener.Close()\n\t}()\n\tfor {\n\t\tconn, err := listener.Accept()\n\t\tif err != nil {\n\t\t\tif ctx.Err() != nil || errors.Is(err, net.ErrClosed) {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\treturn fmt.Errorf(\"native runtime named-pipe accept: %w\", err)\n\t\t}\n\t\tgo serveConn(ctx, conn, runtime)\n\t}\n}\n","sourceCodeStart":50,"sourceCodeEnd":73,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/3ee70a102609e550bd2e68004bf5990a9341c851/proxy/internal/nativeruntime/server_windows.go#L50-L73","documentation":"This error wraps a failure from listener.Accept() on the Windows named-pipe listener. Serve returns it only when the accept fails for a reason other than context cancellation or normal listener closure. It indicates the pipe server could not hand off an incoming connection.","triggerScenarios":"Accept returns an unexpected OS error during the accept loop — e.g. the pipe instance is in a broken state, the handle was closed unexpectedly by something other than the ctx listener.Close(), or a system-level pipe error occurs.","commonSituations":"External code closing the listener without cancelling ctx, resource exhaustion on the pipe handle, or driver/OS-level pipe corruption under heavy connection churn.","solutions":["Inspect the wrapped error with errors.Is/errors.As to identify the OS-level cause","Ensure the listener is only closed via the ctx cancellation path (or that net.ErrClosed paths are respected)","Restart the runtime server process if the pipe handle entered a broken state","Check system logs for named-pipe/driver errors under load"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := srv.Serve(ctx); err != nil {\n    if errors.Is(err, net.ErrClosed) || ctx.Err() != nil { return nil }\n    log.Printf(\"accept failed: %v\", err)\n    // restart server or surface to caller\n}","preventionTips":["Always cancel ctx (which closes the listener) rather than closing the listener directly","Monitor for repeated accept failures under load","Keep OS and drivers current to avoid pipe-layer bugs","Cap concurrent connections to reduce resource pressure"],"tags":["windows","named-pipe","accept"],"backgroundTag":"connection-refused","analyzedSha":"3ee70a102609e550bd2e68004bf5990a9341c851","analyzedAt":"2026-09-20T15:53:39.229Z","contentChangedAt":"2026-09-20T15:53:39.229Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}