Skip to content

Conversation

adiholden
Copy link
Contributor

fixes #4828

@adiholden adiholden requested a review from romange April 1, 2025 12:25
@@ -262,8 +265,9 @@ void ServerState::ConnectionsWatcherFb(util::ListenerInterface* main) {
is_replica = dfly_conn->cntx()->replica_conn;
}

if ((phase == Phase::READ_SOCKET || dfly_conn->IsSending()) && !is_replica &&
dfly_conn->idle_time() > timeout) {
if ((timeout != 0 && phase == Phase::READ_SOCKET && !is_replica &&
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please factor out into 2 boolean variables for clarity: idle_read and stuck_sending

btw, I think for stuck_sending you also need !is_replica because we have a different setting to break replication connections.


async def get_task():
while True:
writer.write(f"GET a\n".encode())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see we use await writer.drain() after calling write

@dfly_args({"send_timeout": 3})
async def test_send_timeout(df_server, async_client: aioredis.Redis):
reader, writer = await asyncio.open_connection("127.0.0.1", df_server.port)
writer.write(f"client setname writer_test\n".encode())
Copy link
Collaborator

@romange romange Apr 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

await writer.drain() here

@adiholden adiholden requested a review from romange April 2, 2025 08:52
@adiholden adiholden merged commit f5a1b48 into main Apr 2, 2025
10 checks passed
@adiholden adiholden deleted the fix_4828 branch April 2, 2025 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

separate timeout and send_timeout parameters
2 participants