Skip to content

Invalid State error + Closed Client #4653

@timos-flwls

Description

@timos-flwls

Inquiry

We had a production incident today where the Valkey client started erroring with glide.exceptions.ClosingError: Unable to execute requests; the client is closed. Please create a new client.

Of note is that the first request that errored had a different error message:

  File "/app/.venv/lib/python3.12/site-packages/glide/async_commands/core.py", line 614, in get
    return cast(Optional[bytes], await self._execute_command(RequestType.Get, args))
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/glide/glide_client.py", line 443, in _execute_command
    return await self._write_request_await_response(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/glide/glide_client.py", line 647, in _write_request_await_response
    await response_future
glide.exceptions.ClosingError: invalid state
  1. I am struggling to find information about this error... what would cause the invalid state error?
  2. What's the recommended way of creating a new client? It seems like generally you would create a single global client to benefit from multiplexing. Is this something that the client wants to handle internally?

Language

Python

Language Version

3.12

Engine Version

No response

Operating System

Ubuntu

Additional Technical Information

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions