【发布时间】:2019-02-21 20:12:12
【问题描述】:
我遇到了 nodejs v8.11.3 的问题。我正在使用带有 TLS (https) 的 http2,并且当客户端关闭会话时服务器中止。这是错误:
HTTP2 31334: Http2Session server: socket closed
HTTP2 31334: Http2Session server: marking session closed
HTTP2 31334: Http2Session server: submitting goaway
node[31334]: ../src/tls_wrap.cc:604:virtual int node::TLSWrap::DoWrite(node::WriteWrap*, uv_buf_t*, size_t, uv_stream_t*): Assertion `(ssl_) != (nullptr)' failed.
1: node::Abort() [node]
2: 0x8c25db [node]
3: node::TLSWrap::DoWrite(node::WriteWrap*, uv_buf_t*, unsigned long, uv_stream_s*) [node]
4: node::http2::Http2Session::SendPendingData() [node]
5: 0x90e769 [node]
6: node::Environment::RunAndClearNativeImmediates() [node]
7: node::Environment::CheckImmediate(uv_check_s*) [node]
8: 0x141a4ac [node]
9: uv_run [node]
10: node::Start(uv_loop_s*, int, char const* const*, int, char const* const*) [node]
11: node::Start(int, char**) [node]
12: __libc_start_main [/lib/x86_64-linux-gnu/libc.so.6]
13: 0x89b1b1 [node]
Aborted (core dumped)
让我感到困惑的是为什么尽管套接字已经关闭,但服务器仍然发出 GOAWAY 帧?
有人知道避免这个问题的一些怪癖吗?
注意:问题并不总是发生,但可以作为更复杂的测试场景的一部分重现。
怪异解决方案
查看答案。
【问题讨论】: