{"record":{"id":"9cfbe4a1234354e4","repo":"XX-net/XX-Net","slug":"send-split-sni-s-fail-r","errorCode":null,"errorMessage":"send split SNI:%s fail:%r","messagePattern":"send split SNI:(.+?) fail:%r","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"code/default/smart_router/local/pipe_socks.py","lineNumber":266,"sourceCode":"                        if p1 > 1:\n                            if b\"google\" in s2.host:\n                                p2 = d.find(b\"google\") + 3\n                            else:\n                                p2 = p1 + len(s2.host) - 6\n\n                            d1 = d[:p2]\n                            d2 = d[p2:]\n\n                            try:\n                                flush_send_s(s2, d1)\n                                s2.sent_data += len(d1)\n                                s2.sent_times += 1\n                            except BlockingIOError as e:\n                                xlog.warn(\"Except %s flush_send_s BlockingIOError %r\", s2, e)\n                                self.close(s2, \"w\")\n                                continue\n                            except Exception as e:\n                                xlog.warn(\"send split SNI:%s fail:%r\", s2.host, e)\n                                self.close(s2, \"w\")\n                                continue\n\n                            s2.add_dat(d2)\n                            d = b\"\"\n                            xlog.debug(\"pipe send split SNI:%s\", s2.host)\n\n                    if s2.buf_size == 0:\n                        try:\n                            sent = s2.send(d)\n                            s2.sent_data += sent\n                            s2.sent_times += 1\n                            # xlog.debug(\"direct send %d to %s from:%s total:%d\", sent, s2, s1, len(d))\n                        except BlockingIOError as e:\n                            xlog.warn(\"Except %s send BlockingIOError %r\", s2, e)\n                            sent = 0\n                        except socket.error as e:\n                            if e.errno == errno.EAGAIN:","sourceCodeStart":248,"sourceCodeEnd":284,"githubUrl":"https://github.com/XX-net/XX-Net/blob/cfa5bc17b67676e467f37ec50766127e0ab5f0aa/code/default/smart_router/local/pipe_socks.py#L248-L284","documentation":"A generic exception (not BlockingIOError) escaped flush_send_s() while sending the first half of a split-SNI request to s2. The write side is closed and the connection abandoned.","triggerScenarios":"Any non-EAGAIN socket error during flush_send_s: connection reset by peer, broken pipe, SSL error on a wrapped socket, or bad buffer state after SNI splitting.","commonSituations":"Remote proxy resets the connection mid-write; TLS handshake failure on wrapped socket; upstream closed during large buffered flush.","solutions":["Inspect the logged %r exception to identify the real cause (reset/broken pipe/SSL)","Verify remote endpoint reachability and that the peer accepts the split-SNI connection","Handle the exception without closing only the write side if full teardown is intended","Add retry with a different route/endpoint"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"except Exception as e: log repr(e); classify reset/broken-pipe vs programming error before closing.","preventionTips":["Log the exception repr to distinguish causes","Validate remote endpoint health before flushing buffered data"],"tags":["network","socket-error","sni-split","pipe"],"backgroundTag":"socket-send-failure","analyzedSha":"cfa5bc17b67676e467f37ec50766127e0ab5f0aa","analyzedAt":"2026-08-27T19:28:28.225Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}