arena icon indicating copy to clipboard operation
arena copied to clipboard

Fix queue details not loading - because of switch from node-redis to ioredis

Open oyvindneu opened this issue 4 years ago • 4 comments

I see you already have a PR for this #219 fixing issue #218 - but now you have another option.

Waiting for ioredis to implement this feature to fix this problem seems futile.

Looking at their code (below) it is not very advanced parsing only good enough to use the result when doing readyCheck.

In order for them to expose this API they they need to write new robust code and it seems like this is not prioritized and it is a bigger task than one off parsing for use in Arena. The risk of doing this in Arena is smaller since - since Arena use a list of allowed fields anyway, so any parsing errors will be hidden from the en user.

https://github.com/luin/ioredis/blob/master/lib/redis/index.ts#L558

    const info: { [key: string]: any } = {};

    const lines = res.split("\r\n");
    for (let i = 0; i < lines.length; ++i) {
      const [fieldName, ...fieldValueParts] = lines[i].split(":");
      const fieldValue = fieldValueParts.join(":");
      if (fieldValue) {
        info[fieldName] = fieldValue;
      }
    }

oyvindneu avatar Nov 16 '21 16:11 oyvindneu

Do you have an example that uses this feature?

bradvogel avatar Nov 23 '21 23:11 bradvogel

Sorry for the late reply.

It fixes the regression with Redis statistics not being loaded after bullmq switched to ioredis.

At the moment it looks like this - note the "Could not retrieve value" - this is because arena can't read the result of client.info() the same way it could before (when bullmq relied on node-redis).

This issue: https://github.com/bee-queue/arena/issues/218

image

oyvindneu avatar Dec 16 '21 16:12 oyvindneu

@bradvogel do you need a better example?

oyvindneu avatar Jan 31 '22 13:01 oyvindneu

@oyvindneu Thanks for the ping and apologies for not responding before. Mind adding a quick unit test for this function?

@Rua-Yuki Mind taking a look at this? It's similar to your PR https://github.com/bee-queue/arena/pull/219.

bradvogel avatar Feb 02 '22 13:02 bradvogel