Grpc-node: @grpc/grpc-js Abort on ClientReadableStream cancel

Created on 10 Dec 2020  路  3Comments  路  Source: grpc/grpc-node

Problem description

invoking ClientReadableStream.cancel() cause abort

node[8728]: ../src/node_http2.cc:448:void node::http2::Http2Session::CheckAllocatedSize(size_t) const: Assertion `(current_nghttp2_memory_) >= (previous_size)' failed.
 1: 0xa03530 node::Abort() [node]
 2: 0xa035ae  [node]
 3: 0xa3ba6b node::mem::NgLibMemoryManager<node::http2::Http2Session, nghttp2_mem>::ReallocImpl(void*, unsigned long, void*) [node]
 4: 0xa3bc43 node::mem::NgLibMemoryManager<node::http2::Http2Session, nghttp2_mem>::FreeImpl(void*, void*) [node]
 5: 0x1865d81 nghttp2_session_close_stream [node]
 6: 0x186c4e4 nghttp2_session_mem_recv [node]
 7: 0xa2faa9 node::http2::Http2Session::ConsumeHTTP2Data() [node]
 8: 0xa2fe18 node::http2::Http2Session::OnStreamRead(long, uv_buf_t const&) [node]
 9: 0xada258 node::LibuvStreamWrap::OnUvRead(long, uv_buf_t const*) [node]
10: 0x1385197  [node]
11: 0x1385b50  [node]
12: 0x138c545  [node]
13: 0x137a398 uv_run [node]
14: 0xa438d4 node::NodeMainInstance::Run() [node]
15: 0x9d1735 node::Start(int, char**) [node]
16: 0x7fd5025050b3 __libc_start_main [/lib/x86_64-linux-gnu/libc.so.6]
17: 0x96971c  [node]
Aborted

but when I use 'grpc' module with same code, there is no abort.

Reproduction steps

invoke ClientReadableStream.cancel()

Environment

  • OS name, version and architecture: [WSL Ubuntu 20.04.1 amd64]
  • Node version [14.15.1]
  • Node installation method [nvm]
  • If applicable, compiler version []
  • Package name and version [@grpc/[email protected]]

Additional context

Most helpful comment

Wrapping the .cancel() call with setTimeout/setImmediate seems to mitigate the error.

All 3 comments

I believe this may be related to #1464.

Wrapping the .cancel() call with setTimeout/setImmediate seems to mitigate the error.

Wrapping the .cancel() call with setTimeout/setImmediate seems to mitigate the error.

this works for me

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Aswathi17 picture Aswathi17  路  3Comments

yanbou893 picture yanbou893  路  5Comments

samiq picture samiq  路  5Comments

moloch-- picture moloch--  路  5Comments

lucavallin picture lucavallin  路  5Comments