javascript-express icon indicating copy to clipboard operation
javascript-express copied to clipboard

Error: You can only call finish() on a span once. NodeJS 10+

Open chagen19 opened this issue 5 years ago • 9 comments

We are getting the error "You can only call finish() on a span once." frequently and it seems to be related to the event handlers that are registered in middleware.js: res.on('close', finishSpan); res.on('finish', finishSpan);

According to the issue below, starting in Node 10 there was a change to how close is being called. It sounds like res.on('close', finishSpan) needs to be changed to res.on('abort', finishSpan); to resolve this issue.

https://github.com/glebec/volleyball/issues/28

chagen19 avatar Jul 08 '19 22:07 chagen19

We're experiencing this as well. It would be great to get a fix for this

firthh avatar Feb 18 '20 11:02 firthh

Is there anything that prevents #18 to be merged?

rafabene avatar Mar 01 '20 21:03 rafabene

I would love it dearly if #18 could be merged as well!

obscurerichard avatar Jun 21 '20 02:06 obscurerichard

#18 was merged today

meschbach avatar Aug 18 '20 16:08 meschbach

Fantastic. Is it possible to get that published to that packaged and published to NPM?

firthh avatar Aug 19 '20 10:08 firthh

I should be able to get it published this week, hopefully by tomorrow.

austinlparker avatar Aug 19 '20 12:08 austinlparker

Hi @austinlparker, would you be able to publish this to NPM sometime soon? Looking forward to use this fix.

kewats avatar Sep 09 '20 21:09 kewats

Hey @austinlparker, sorry to bump this thread again - but is there any chance of a release of this? As the project is compiled it's not possible to simply pull this in via the github commit sha.

Limess avatar Dec 15 '20 11:12 Limess

it seems @rnburn is the owner of NPM package? https://www.npmjs.com/package/express-opentracing

yurishkuro avatar Jan 07 '21 18:01 yurishkuro