Skip to content

Clean up logs when no bytes are sent in an opened connection to query scheduler #1386

@coderabbitai

Description

@coderabbitai

Context

During health checks of the query scheduler, when a TCP connection is opened without sending data (e.g., < /dev/tcp/query_scheduler/7000), the scheduler logs verbose error messages about incomplete reads.

Current Behaviour

Every empty request produces this error in the logs:

future: <Task finished name='Task-16' coro=<handle_reducer_connection() done, defined at /opt/clp/lib/python3/site-packages/job_orchestration/scheduler/query/reducer_handler.py:104> exception=IncompleteReadError('0 bytes read on a total of 8 expected bytes')>

Traceback (most recent call last):
  File "/opt/clp/lib/python3/site-packages/job_orchestration/scheduler/query/reducer_handler.py", line 110, in handle_reducer_connection
    message_bytes = await _recv_msg_from_reducer(reader)
  File "/opt/clp/lib/python3/site-packages/job_orchestration/scheduler/query/reducer_handler.py", line 87, in _recv_msg_from_reducer
    msg_size_bytes = await reader.readexactly(8)
  File "/usr/lib/python3.10/asyncio/streams.py", line 706, in readexactly
    raise exceptions.IncompleteReadError(incomplete, n)
asyncio.exceptions.IncompleteReadError: 0 bytes read on a total of 8 expected bytes

Desired Behaviour

The query scheduler should handle empty connections gracefully without logging errors or stack traces.

References

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions