Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@grpc/grpc-js Abort on ClientReadableStream cancel #1652

Open
ozt88 opened this issue Dec 10, 2020 · 9 comments
Open

@grpc/grpc-js Abort on ClientReadableStream cancel #1652

ozt88 opened this issue Dec 10, 2020 · 9 comments

Comments

@ozt88
Copy link

ozt88 commented Dec 10, 2020

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

@ozt88 ozt88 changed the title Abort on ClientReadableStream cancel @grpc/grpc-js Abort on ClientReadableStream cancel Dec 10, 2020
@sangaman
Copy link
Contributor

I believe this may be related to #1464.

@LePremierHomme
Copy link

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

@ozt88
Copy link
Author

ozt88 commented Dec 22, 2020

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

this works for me

@mdouglass
Copy link
Contributor

I've opened an issue against nodejs as I ran into a similar issue nodejs/node#38964

@bl-ue
Copy link

bl-ue commented Jun 8, 2021

I'm investigating it there.

@bl-ue
Copy link

bl-ue commented Jun 8, 2021

ping @jasnell: see the stacktrace? Does that tell you anything right away?

@murgatroid99
Copy link
Member

This is a Node bug and it appears to have been fixed in Node.

@Matt-Esch
Copy link

This issue has not been completely fixed in node nodejs/node#38964 is still open

@murgatroid99
Copy link
Member

Yes, I see that that issue was reopened since I made that comment. It is still a Node bug, not a grpc-js bug.

@murgatroid99 murgatroid99 reopened this Aug 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants