wechaty / grpc

gRPC Service & Protocol Buffers for Wechaty Puppet
https://wechaty.github.io/grpc/
Apache License 2.0
25 stars 22 forks source link

node_http2.cc: void node::http2::Http2Session::CheckAllocatedSize(size_t) const: Assertion `(current_nghttp2_memory_) >= (previous_size)' failed. #130

Closed huan closed 3 years ago

huan commented 3 years ago

When upgrading from grpc to grpc-js, we encountered the following error in tests/integration.spec.ts:

https://github.com/wechaty/grpc/blob/920bebdf4ccce5567a50557d7baabf2fd0777426/tests/integration.spec.ts#L91-L93

node[122920]: ../src/node_http2.cc:449:void node::http2::Http2Session::CheckAllocatedSize(size_t) const: Assertion `(current_nghttp2_memory_) >= (previous_size)' failed.

Node Versions

All node major versions will be affected: 10/12/14/15

Similiar Issues

Workaround

+ await new Promise(resolve => setImmediate(resolve))
eventStream.cancel() 
mdouglass commented 3 years ago

I opened https://github.com/nodejs/node/issues/38964 against nodejs as I ran into the same assertion failure you saw. The same setImmediate fix you suggested helps with my repro case as well, but thought you might want to track the issue on nodejs side as well.

huan commented 3 years ago

Thanks for filing the issue on the nodejs side, I believe there must be a bug in nodejs and it should be definitely fixed.

huan commented 3 years ago

According to https://github.com/nodejs/node/issues/38964#issuecomment-863917244 I believe this problem will be fixed in the next major version of Node.js.

However, for maximum compatibility for our module, we should keep this workaround "as-it-is", which means we will not remove the workaround.