question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Transactions not always ended if client closes socket prematurely

See original GitHub issue

The first test in test/instrumentation/modules/http/aborted-requests-enabled.js randomly hangs and never completes on Jenkins. It happens every 5 times or so we run a test on Jenkins and it happens on multiple different versions of Node.js.

This might be related to elastic/apm-agent-nodejs#1350

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
watsoncommented, Oct 9, 2019

I created a separate issue regarding marking the transaction as aborted: elastic/apm#154

0reactions
watsoncommented, Oct 8, 2019

How about we hook into OutgoingMessage.end, ending the transaction immediately if the request is aborted (req.aborted), since data won’t be buffered any more, and otherwise wait for prefinish?

That sounds like a great idea. Unless there’s some hidden edge case that I haven’t thought of yet, it might just work 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

4.7. The Mysteries of Connection Close - HTTP - O'Reilly
When a connection closes after some request data was sent but before the response is returned, the client cannot be 100% sure how...
Read more >
Why the TCP server socket is closed unexpectedly?
Ah, I said that almost of connection loss problems will be occured due to server side. Sorry, it can be occured due to...
Read more >
Why doesn't client's close() of socket cause server's select() to ...
On the server's side, the socket is created via an accept() call, is blocking, is passed to a child server process via fork(),...
Read more >
Passenger should not process requests from clients that have ...
But the only way to detect whether a client has disconnected, is by reading from its socket, or by writing to its socket....
Read more >
How to detect when the client closes the connection?
The problem is: How can we tell if a socket connection has been closed by the client? We need a separate process that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found