-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
fix: Redis 4 does not reconnect after unhandled error #8706
Conversation
Thanks for opening this pull request! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a test that demonstrates the issue before adding the fix and the passes with the fix?
It seems strange that adding empty handlers fixed this. Could you add a Redis docs reference that describes this requirement?
This makes me think which version of Redis we are actually testing with. It seems we need a compatibility table to the README and test with multiple versions just like we do with MongoDB. In our CI we are currently not specifying a Redis version, so it's using the latest version from Docker, which I think is Redis 7.0.12. Without testing with explicit versions I don't think we should merge this PR because the change may break compatibility with another Redis version.
I agree it's strange. Here is the Redis issue that led me to the solution for reference. There's also some discussion on how to reliably recreate the issue, it seems that hosted Redis servers like Digital Ocean or Heroku do this pretty often. I don't think the server version matters for this, only the client version, and it seems these handlers didn't change between version 3.x of the client and 4.x - only their requirement to exist. From that issue it links to the main readme that has a bit more information, and that also confirms the need for event handlers and the error thrown if they aren't handled: https://github.com/redis/node-redis#events . It seems we technically only need to add an I'm not sure offhand how to test this scenario, but let me investigate and see if there's something I can put together for that. |
For what it is worth, I am seeing the same issue on Heroku with the latest version of parse-server (6.2.1). Redis version is 6.2.13. |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## alpha #8706 +/- ##
==========================================
+ Coverage 94.32% 94.33% +0.01%
==========================================
Files 185 185
Lines 14762 14766 +4
==========================================
+ Hits 13924 13930 +6
+ Misses 838 836 -2
☔ View full report in Codecov by Sentry. |
@Vortec4800 Did you find a way to add a test for this? If not, we may as well merge as is; if you could just take a look at the Lint error. We just have to be sure that this is not a breaking change in a certain scenario. |
I'm sorry - work got busy and I haven't had a chance to look at this further. I did just add a quick change that should address the lint error, and log client errors via the internal logger. Take a look and let me know if that's appropriate. I can also add info logs to the other client events if you think that would be a good idea. |
Thanks for the commits, let's see if the CI passes... |
Signed-off-by: Cory Imdieke <[email protected]>
Signed-off-by: Cory Imdieke <[email protected]>
Signed-off-by: Cory Imdieke <[email protected]>
Signed-off-by: Cory Imdieke <[email protected]>
It's strange that this one Postgres job keeps failing in the CI, I've restarted it several times. Restarted again. |
# [6.3.0-alpha.8](6.3.0-alpha.7...6.3.0-alpha.8) (2023-08-30) ### Bug Fixes * Redis 4 does not reconnect after unhandled error ([#8706](#8706)) ([2b3d4e5](2b3d4e5))
🎉 This change has been released in version 6.3.0-alpha.8 |
# [6.4.0-beta.1](6.3.0...6.4.0-beta.1) (2023-09-16) ### Bug Fixes * Parse Server option `fileUpload.fileExtensions` does not work with an array of extensions ([#8688](#8688)) ([6a4a00c](6a4a00c)) * Redis 4 does not reconnect after unhandled error ([#8706](#8706)) ([2b3d4e5](2b3d4e5)) * Remove config logging when launching Parse Server via CLI ([#8710](#8710)) ([ae68f0c](ae68f0c)) * Server does not start via CLI when `auth` option is set ([#8666](#8666)) ([4e2000b](4e2000b)) ### Features * Add conditional email verification via dynamic Parse Server options `verifyUserEmails`, `sendUserEmailVerification` that now accept functions ([#8425](#8425)) ([44acd6d](44acd6d)) * Add property `Parse.Server.version` to determine current version of Parse Server in Cloud Code ([#8670](#8670)) ([a9d376b](a9d376b)) * Add TOTP authentication adapter ([#8457](#8457)) ([cc079a4](cc079a4)) ### Performance Improvements * Improve performance of recursive pointer iterations ([#8741](#8741)) ([45a3ed0](45a3ed0))
🎉 This change has been released in version 6.4.0-beta.1 |
# [6.4.0-alpha.1](6.3.0...6.4.0-alpha.1) (2023-09-20) ### Bug Fixes * Parse Server option `fileUpload.fileExtensions` does not work with an array of extensions ([#8688](#8688)) ([6a4a00c](6a4a00c)) * Redis 4 does not reconnect after unhandled error ([#8706](#8706)) ([2b3d4e5](2b3d4e5)) * Remove config logging when launching Parse Server via CLI ([#8710](#8710)) ([ae68f0c](ae68f0c)) * Server does not start via CLI when `auth` option is set ([#8666](#8666)) ([4e2000b](4e2000b)) ### Features * Add conditional email verification via dynamic Parse Server options `verifyUserEmails`, `sendUserEmailVerification` that now accept functions ([#8425](#8425)) ([44acd6d](44acd6d)) * Add context to Cloud Code Triggers `beforeLogin` and `afterLogin` ([#8724](#8724)) ([a9c34ef](a9c34ef)) * Add property `Parse.Server.version` to determine current version of Parse Server in Cloud Code ([#8670](#8670)) ([a9d376b](a9d376b)) * Add TOTP authentication adapter ([#8457](#8457)) ([cc079a4](cc079a4)) ### Performance Improvements * Improve performance of recursive pointer iterations ([#8741](#8741)) ([45a3ed0](45a3ed0))
🎉 This change has been released in version 6.4.0-alpha.1 |
# [6.4.0](6.3.1...6.4.0) (2023-11-16) ### Bug Fixes * Parse Server option `fileUpload.fileExtensions` does not work with an array of extensions ([#8688](#8688)) ([6a4a00c](6a4a00c)) * Redis 4 does not reconnect after unhandled error ([#8706](#8706)) ([2b3d4e5](2b3d4e5)) * Remove config logging when launching Parse Server via CLI ([#8710](#8710)) ([ae68f0c](ae68f0c)) * Server does not start via CLI when `auth` option is set ([#8666](#8666)) ([4e2000b](4e2000b)) ### Features * Add conditional email verification via dynamic Parse Server options `verifyUserEmails`, `sendUserEmailVerification` that now accept functions ([#8425](#8425)) ([44acd6d](44acd6d)) * Add property `Parse.Server.version` to determine current version of Parse Server in Cloud Code ([#8670](#8670)) ([a9d376b](a9d376b)) * Add TOTP authentication adapter ([#8457](#8457)) ([cc079a4](cc079a4)) ### Performance Improvements * Improve performance of recursive pointer iterations ([#8741](#8741)) ([45a3ed0](45a3ed0))
🎉 This change has been released in version 6.4.0 |
Pull Request
Issue
Closes: #8705
Approach
Adds mostly empty event handlers to the Redis client, which is now required for Redis 4.
Tasks