kezhenxu94 commented on pull request #20:
URL: https://github.com/apache/skywalking-nodejs/pull/20#issuecomment-752965213
> > > Hopefully this can be extracted as an individual reusable module /
class. Also note not to copy the codes from on-finished because of licensing
issues.
> >
> >
> > Actually not even extract anything, I think its just adding a listener
on request socket error or close and removing the `stopIfNotStopped()` in
response listener.
>
> Actually its as simple as removing `stopIfNotStopped()` on line 97 since
the end of the request is already hooked to stop:
>
> ```js
> request.on('close', stopIfNotStopped);
> request.on('abort', () => (span.errored = true, stopIfNotStopped()));
> request.on('error', (err) => (span.error(err), stopIfNotStopped()));
> ```
Removed, let's see what the test result looks like
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]