Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RangeError: Maximum call stack size exceeded due to mysql instrumentation #641

Closed
samuelg opened this issue Apr 2, 2020 · 5 comments
Closed
Labels

Comments

@samuelg
Copy link

samuelg commented Apr 2, 2020

We went live with airbrake integration in one of our applications on March 18th and started seeing our application crash 2-3 times a day since starting on the 19th (24 times in total so far). We keep 2 months worth of logs and have never seen this before going live with the airbrake integration.

We are actually receiving an airbrake for this error, which is good.

The error seems to point to the MySQL instrumentation inside this package being the culprit:

node_modules/mysql/lib/Connection.js:198:25 in PoolConnection.query
node_modules/@airbrake/node/dist/instrumentation/mysql.js:55:30 in PoolConnection.abQuery
node_modules/@airbrake/node/dist/instrumentation/mysql.js:55:30 in PoolConnection.abQuery
node_modules/@airbrake/node/dist/instrumentation/mysql.js:55:30 in PoolConnection.abQuery
node_modules/@airbrake/node/dist/instrumentation/mysql.js:55:30 in PoolConnection.abQuery
node_modules/@airbrake/node/dist/instrumentation/mysql.js:55:30 in PoolConnection.abQuery
node_modules/@airbrake/node/dist/instrumentation/mysql.js:55:30 in PoolConnection.abQuery
node_modules/@airbrake/node/dist/instrumentation/mysql.js:55:30 in PoolConnection.abQuery
node_modules/@airbrake/node/dist/instrumentation/mysql.js:55:30 in PoolConnection.abQuery
node_modules/@airbrake/node/dist/instrumentation/mysql.js:55:30 in PoolConnection.abQuery

We are using the following packages which account for the entire MySQL usage in that application:

{
  "express": "^4.17.1",
  "express-mysql-session": "^2.1.4",
  "express-session": "^1.17.0",
}

Here is our session middleware config:

{
  // key and secret omitted
  resave: false,
  saveUninitialized: true,
}

Here is our session store config:

{
  expiration: 60 * 60 * 24 * 14, // two weeks milliseconds
}

We are currently only calling notify manually to send errors to Airbrake and are not actually using any of the instrumentation provided by this package. Would it be possible to get an option to selectively disable the instrumentation that runs by default today at https://github.com/airbrake/airbrake-js/blob/master/packages/node/src/notifier.ts#L107?

@sgray
Copy link
Contributor

sgray commented Apr 2, 2020

Hi, @samuelg. Thanks for the report. Yes, we can add an option for that. I should be able to get to it pretty soon. As for the underlying bug, I'll try to reproduce it using the information you've provided and get back to you.

@sgray
Copy link
Contributor

sgray commented Apr 3, 2020

I've attempted to recreate the bug in a small sample app without any luck. @samuelg would you be able to provide an example app that exhibits the error in question?

@samuelg
Copy link
Author

samuelg commented Apr 3, 2020

Not easily no. The application is proprietary so ripping out most of the sensitive code would be non trivial.

We are seeing this occur 2 times a day or so with thousands of requests, I would not expect this to be easy to reproduce unless you are running automation to fire requests non stop for hours. Most of the requests accessing and storing sessions are working without issues. I have a theory it's related to clearing expired sessions but have not been able to confirm this.

We would be content to get an option to disable the instrumentations at this point which I see you have a PR for already. Thank you for that!

@sgray
Copy link
Contributor

sgray commented Apr 9, 2020

I've released version 1.0.7 with the additional config option. Please let me know if anything else is needed.

@sgray sgray closed this as completed Apr 9, 2020
@samuelg
Copy link
Author

samuelg commented Apr 16, 2020

We have not had another reoccurrence of this issue since upgrading to 1.0.7 a week ago. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants