question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

@grpc/grpc-js Abort on ClientReadableStream cancel

See original GitHub issue

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/grpc-js@1.2.2]

Additional context

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:4
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

8reactions
LePremierHommecommented, Dec 21, 2020

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

3reactions
sangamancommented, Dec 18, 2020

I believe this may be related to #1464.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Documentation Class: ClientReadableStream - gRPC on GitHub
Cancel the ongoing call. Results in the call ending with a CANCELLED status, unless it has already ended with some other status.
Read more >
Basics tutorial | Node - gRPC
This tutorial provides a basic Node.js programmer's introduction to working with gRPC. By walking through this example you'll learn how to:.
Read more >
grpc - Bountysource
invoking ClientReadableStream.cancel() cause abort ... Did you mean to import @grpc-grpc-js-npm-1.3.2-0e02c36ae3-39cab06165.zip/node_modules/@grpc/grpc-js/ ...
Read more >
Cancel grpc call from client on server streaming - Stack Overflow
I have tried call.end and call.destroy and call.cancel but end and ... (...grpc\node_modules\@grpc\grpc-js\build\src\client.js:330:49) at ...
Read more >
ReadableStream.cancel() - Web APIs - MDN Web Docs
The cancel() method of the ReadableStream interface returns a Promise that resolves when the stream is canceled.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found