Navigation Menu

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

Kue is swallowing errors from Redis #1197

Open
Gappa88 opened this issue Jul 26, 2018 · 0 comments
Open

Kue is swallowing errors from Redis #1197

Gappa88 opened this issue Jul 26, 2018 · 0 comments

Comments

@Gappa88
Copy link

Gappa88 commented Jul 26, 2018

hi,

I have a Nodejs (v8.11) application that writes data to Redis (v4.0.10) via Kue (v0.11.6).
I sat a maxmemory limit to Redis and when I reach that limit Kue doesn't properly handle errors from redis.

The bugged function is this in detail here.

this.set('data', json, function() {   // missing return parameters (err, foo)
    // state
    this.state(this._state, fn);
  }.bind(this));

where the callback function doesn't handle return parameters.

This bug is swallowing important Redis' errors like

OOM command not allowed when used memory > 'maxmemory'

does anyone have a patch that solve this and allow me to take errors back to the main function caller in order to handle it?

can this snippet solve cleanly the problem, @behrad?

this.set('data', json, function (err) { // <=== err added

    if (err) return fn(err);   // <=== return the error
    // state
    this.state(this._state, fn);
  }.bind(this));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant