Fix queue details view showing stale Redis stats#219
Open
Rua-Yuki wants to merge 1 commit intobee-queue:masterfrom
Open
Fix queue details view showing stale Redis stats#219Rua-Yuki wants to merge 1 commit intobee-queue:masterfrom
Rua-Yuki wants to merge 1 commit intobee-queue:masterfrom
Conversation
The ioredis client used by bull makes no guarantees that the `serverInfo` field be updated upon issuing an INFO command, and in fact does not appear to do so (given bull 3.13.0 and ioredis 4.16.3). While the `serverInfo` field is indeed populated after the initial connection is established, it is not updated by calling INFO as assumed with the previous logic. This results in stale data being presented by Arena. Rather than relying on this undocumented and evidently fragile behaviour, we can instead parse the result of the INFO command on our own. This also happens to step around an issue with the way that ioredis parses key-value data in handling the INFO response, where values containing the colon character are incorrectly trimmed. Given the stability and superb backwards-compatibility of Redis, this should be a highly reliable solution.
Member
|
It'd be nice if |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes #218.
Rather than relying on inconsistent behaviour which ioredis no longer appears to demonstrate, the resulting data from issuing an
INFOcommand is parsed directly.As an alternative to recreating the wheel with an info parser here, we could always rely on a library such as
node-redis-infoto have things handled.