openresty / openresty/lua-resty-redis

How to handle tcp socket timeouts error handling?

Open
#192 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Lua
Stars
2k
Forks
447
Avg merge
2h 24m
Merged PRs (30d)
3

Description

We get a few "lua tcp socket read timed out" errors and I'd like to add proper error handling for it.

I thought I have already implemented correct error handling for all commands like:
local redok, rederr = red:connect(redis_pool[counter])
(& then handling the redok/rederr case; also for all get/mget,...)

But I still get these error in nginx error log.
(Note: I do NOT have set lua_socket_log_errors off; yet, since I want to be sure I have errors handled correctly before doing that)

Contributor guide

No contributing guide indexed for this repository

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 by reviewing the redis:connect, get, and mget call sites mentioned in the issue, along with the lua_socket_log_errors setting. Trace how timeout results are handled and determine what behavior should count as correctly handled; the issue does not name files, tests, or a specific change.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua, redis
Domain
backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.