Fails to serialize errors containing a http.ClientRequest
See original GitHub issueI’m still trying to make a reduced, reproducible case for this one. However, I thought someone might have some ideas about what’s going on.
Running some tests with ava
, which performs an HTTP request. At some point it encounters an error that should be sent from the worker to the master process, which calls serialize-error
to be able to safely pass the data. After a while it crashes the node process with the following info:
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory
<--- Last few GCs --->
81235 ms: Mark-sweep 1397.3 (1458.0) -> 1397.0 (1458.0) MB, 1140.1 / 0 ms [allocation failure] [GC in old space requested].
82397 ms: Mark-sweep 1397.0 (1458.0) -> 1397.0 (1458.0) MB, 1161.6 / 0 ms [allocation failure] [GC in old space requested].
83542 ms: Mark-sweep 1397.0 (1458.0) -> 1397.0 (1458.0) MB, 1144.9 / 0 ms [last resort gc].
84681 ms: Mark-sweep 1397.0 (1458.0) -> 1397.0 (1458.0) MB, 1139.0 / 0 ms [last resort gc].
<--- JS stacktrace --->
==== JS stack trace =========================================
Security context: 0x291f70db4629 <JS Object>
1: destroyCircular(aka destroyCircular) [/home/espenh/webdev/crown/node_modules/serialize-error/index.js:~20] [pc=0xd42dc460314] (this=0x291f70d041b9 <undefined>,from=0x1f20d233a839 <an Object with map 0x32ba4fda171>,seen=0x2c9b3e0260f1 <JS Array[25]>)
2: /* anonymous */(aka /* anonymous */) [/home/espenh/webdev/crown/node_modules/serialize-error/index.js:47] [pc=0xd42dc44cb31] (this=0x...
With some trial and error, I’ve reduced the problem down
props.error.powerAssertContext.args[0].events[0].value.request
. If I exclude this property from the serialization process, it works.
Right before the process fails, it outputs:
(node) Server.connections property is deprecated. Use Server.getConnections method instead.
Any ideas on what is going on here? It seems like there might be a circular reference within the request somehow, that is not being picked up by destroyCircular
, properly. I can’t seem to easily reproduce it in the tests for serialize-error
, however.
Issue Analytics
- State:
- Created 8 years ago
- Comments:6 (2 by maintainers)
Top GitHub Comments
@twada Thanks. My god, this is so counter-intuitive:
@rexxars
Agreed. I’m so sorry for inconvenience 😦 Should be fixed soon.