Azure / Azure/azure-sdk-for-java

Handling when http-netty4 read handlers are added to closed channel

Open
#45,046 0 comments 0 reactions 1 assignee Claimed by @alzimmermsft View on GitHub
clientcore HttpClient
Dominant language
Java
Stars
2.6k
Forks
2.2k
Avg merge
2d 8h
Merged PRs (30d)
178

Description

`Netty4EagerConsumeChannelHandler` and `Netty4InitiateOneReadHandler` should be hardened to handle scenarios where they're added to a closed channel. A possible case where this happens is when `Netty4ProgressAndTimeoutHandler` fires an inactivity exception and closes the channel while another thread attempts to read the channel using one of the read handlers. The read handlers should handle this appropriately, preventing any deadlocking.

The question comes down to what should happen when they are added to a closed channel.

1. They simply count down the `CountDownLatch` are return no content and indicate a completed state to the caller.
2. They throw an exception themselves about an invalid state.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.