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.

Throw an error when a connection ends with a RST,ACK packet?

See original GitHub issue

According to MySQL docs, COM_QUIT command should end with “either a connection close or a OK_Packet”.

As @elemount pointed out in issue #1730, Azure MySQL is answering with an RST,ACK.

It can be reproduced when you run this example code against an Azure MySQL instance.

var mysql      = require('mysql');
var connection = mysql.createConnection({ config });

connection.connect();

connection.query('SELECT 1 + 1 AS solution', function (error, results, fields) {
  if (error) throw error;
  console.log('The solution is: ', results[0].solution);
});

connection.end();

Throws ECONNRESET error.

Should this library throw an error when a connection end with a RST with the ACK flag set? Can we detect this?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:13 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
dougwilsoncommented, Aug 31, 2017

@alex030293 provided a connection to a MySQL Azure instance and I reproduced the issue and have a tentative fix. I should land the fix on master today once I get it cleaned up.

1reaction
dougwilsoncommented, Sep 27, 2017

I have a failing branch pushed up right now. Still need to get Azure set up and finish the changes. This is what is holding the next release, so yes it is expected in the next release.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Raise exception when TCP connection broken - Stack Overflow
Being at end of file is not intrinsically an error, nor is it normally understood to mean a "broken" connection like your title...
Read more >
Error handling in R with tryCatchLog: Catching, logging, post ...
The call stack ends basically with the tryCatch call but does not show you the code line in f() where the error was...
Read more >
'Connection not found' error thrown at end of task, after the ...
I'm fairly new to VS and SSIS. I have created several SSIS packages, basically a package for retrieving data and creating a csv...
Read more >
Continuous RST, ACK flags from the same source - Server Fault
The connection is actively aborted by the server by means of an RST packet, and that packet is arriving almost immediately, much quicker...
Read more >
How to Throw Exceptions (The Java™ Tutorials > Essential ...
Any code can throw an exception: your code, code from a package written by ... The method removes the top element from the...
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