opentracing-contrib / javascript-express

OpenTracing middleware for express
Apache License 2.0
39 stars 20 forks source link

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

Open chagen19 opened 5 years ago

chagen19 commented 5 years ago

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 likeres.on('close', finishSpan) needs to be changed to res.on('abort', finishSpan); to resolve this issue.

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

firthh commented 4 years ago

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

rafabene commented 4 years ago

Is there anything that prevents #18 to be merged?

obscurerichard commented 4 years ago

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

meschbach commented 4 years ago

18 was merged today

firthh commented 4 years ago

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

austinlparker commented 4 years ago

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

kewats commented 4 years ago

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

Limess commented 3 years ago

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.

yurishkuro commented 3 years ago

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