redis / redis/node-redis

Basic example hangs indefinitely with Redis Cloud

Open
#2,029 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug
Dominant language
TypeScript
Stars
17.6k
Forks
2k
Avg merge
2d 3h
Merged PRs (30d)
40

Description

Hello,

When I test the Basic Example with my Redis Cloud account, node hangs indefinitely

testredis.js

import { createClient } from 'redis';
(async () => {
  const client = createClient({
    url: 'redis://redis-11092.c250.eu-central-1-1.ec2.cloud.redislabs.com:11092',
    username: 'admin',
    password: [password],
  });
  client.on('error', (err) => console.log('Redis Client Error', err));
  await client.connect();
  await client.set('key', 'value');
  const value = await client.get('key');
})();

node testredis.js hangs indefinitely -

shane@WIN10PC-SHANE MINGW64 ~/dev/projour (redis)
$ node testredis.js
[no response]

My workaround

Add await client.quit(); after const value = await client.get('key');

Environment:

  • Node.js Version: v16.13.2
  • Redis Server Version: 6.2.3
  • Node Redis Version: 4.0.4
  • Platform: Windows 10 Pro 20H2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Basic Example and reproduce the report using testredis.js and node testredis.js against Redis Cloud. Compare the run with and without await client.quit() and determine whether the example or its documentation needs to show the client shutdown; done means the example no longer appears to hang.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs, redis
Domain
backend, databases
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.