Hi,
When i try to send a request where inside the request there is another request, my system returns the errors below, so i had this problem another time and resolved using "Keep-Alive", but this time i can't use
Version: 8.1.2
Platform: UNIX
Segmentation fault
/usr/local/bin/node[339]: ../src/async-wrap.cc:636:v8::Local<v8::Value> node::AsyncWrap::MakeCallback(v8::Local<v8::Function>, int, v8::Local<v8::Value>*): Assertion `(env()->current_async_id()) == (0)' failed.
1: node::Abort() [node]
2: node::Assert(char const* const (*) [4]) [node]
3: 0x1352ffd [node]
4: node::StreamBase::EmitData(long, v8::Local<v8::Object>, v8::Local<v8::Object>) [node]
5: node::StreamWrap::OnReadImpl(long, uv_buf_t const*, uv_handle_type, void*) [node]
6: node::StreamWrap::OnRead(uv_stream_s*, long, uv_buf_t const*) [node]
7: 0x157446f [node]
8: 0x1574ad0 [node]
9: 0x157a628 [node]
10: uv_run [node]
11: node::Start(uv_loop_s*, int, char const* const*, int, char const* const*) [node]
12: node::Start(int, char**) [node]
13: __libc_start_main [/lib/x86_64-linux-gnu/libc.so.6]
14: 0x8ebc61 [node]
Aborted
_(edited by @vsemozhetbyt: added backticks for code block)_
/cc @nodejs/async_hooks
The "request inside another request" part... not quite sure I follow your meaning. Can you post a code snippet that illustrates the problem?
I've attempted to replicate your issue, but haven't been able to. A better description or example code would be great. Here's the type of test I've come up with so far:
'use strict';
const http = require('http');
const print = (..._) => require('fs').writeSync(1, require('util').format(..._));
const req1 = http.request('http://google.com/', (res1) => {
res1.on('data', (chunk) => print('res1 got chunk\n'));
const req2 = http.request('http://google.com/', (res2) => {
res2.on('data', (chunk) => print('res2 got chunk\n'));
const req3 = http.request('http://google.com/', (res3) => {
res3.on('data', (chunk) => print('res3 got chunk\n'));
req3.end();
req2.end();
req1.end();
});
req3.write('baz');
});
req2.write('bar');
});
req1.write('foo');
Closing this due to lack of activity from @FeeFelipe. We can reopen if things change.
We have been rolling out a lot of fixes regarding the type of issue you are seeing. They will be in v8.2.0 which hasn't been released yet. Until then, you can try the nightly build.
Most helpful comment
The "request inside another request" part... not quite sure I follow your meaning. Can you post a code snippet that illustrates the problem?