Open dy93 opened 8 years ago
@dy93 may I ask you to run this script with DEBUG="spdy*"
environment variable and gist the results?
Thank you!
@indutny I make some change to the testing code to make it clear, here is my testing code to reproduce and the execution output: https://gist.github.com/dy93/3131b97fdb652249832c/78ef8f718c8b6288b86af4e035f6ffd6e7491d1d
Thanks!
@dy93 sorry for quite a big delay. I have bad news for you, this is not node-spdy bug (at seems it doesn't look like it). It looks like this is a V8 bug instead, if you will run node --no_use_ic test.js
- it will work just fine (however it will be much more slower).
I'm still checking it just to be sure, but all evidence that I have so far leads to this conclusion. I will work on resolving V8 issue, but it will probably take more time.
Sorry!
@dy93 btw, it is very likely that the promises are the cause of the problem here. So if you could do what you want without them - I would recommend giving it a try.
@dy93 filed v8 bug: https://code.google.com/p/v8/issues/detail?id=4582&thanks=4582&ts=1448847246 Please star it ;)
@indutny I think it is not a bug related to promise, because I got same error when I continuously make requests 3 times using spdy agent. here is my sample code that does not use promise: https://gist.github.com/dy93/07936cbcc5e624b1206d
btw, I think you're right, it may be a bug related to v8 I have star it, thank you!
I think this might be related to the issue that I just reported. #252.
The spdy module depends on the parser object from the ServerResponse object (part of the node http module). However, after res.end() is called the parser is disposed in some fashion, leaving it in an unusable state.
I think (after a few minutes digging around in the node lib source) that the parser is native module or part of V8. So this behavior makes sense (the GC can't clean it up).
I suspect, the solution is not to borrow the parser from the response, but for this module to create it's own instances of the parser who's life cycle can be controlled independently.
I'm trying to reuse spdy-client to do multiple request to same host, here is my sample code:
above code got following error:
when I put two task() in Promise.all(), it works fine. but when I put more than three task() into it, I got the error. please tell me how to reuse a spdyAgent.
my node version is v4.2.2, and my node-spdy version is 2.1.0 Thanks