You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DurableClientContext gRPC channels are never closed after function invocation #254
Each function invocation creates a new DurableClientContext with its own gRPC client/channel. When the invocation ends, close() is never called, leaving the channel orphaned.
Customer Impact
Customers see repeated warnings in logs:
Previous channel ManagedChannelImpl{logId=X, target=localhost:4001} was not shutdown properly!!!
java.lang.RuntimeException: ManagedChannel allocation site
at io.grpc.internal.ManagedChannelOrphanWrapper$ManagedChannelReference.<init>(ManagedChannelOrphanWrapper.java:102)
Repro
Any Java Durable Functions app using DurableClientContext.getClient() will eventually see these warnings.
Root Cause
DurableClientContext does not implement AutoCloseable and never calls client.close().
PR #249 added proper shutdown logic to DurableTaskGrpcClient.close(), but that method is never called because:
DurableClientContext does not implement AutoCloseable
DurableClientContext has no close() method
The Java Functions worker has no mechanism to close the client after invocation
Suggested fixes
Close the client after each invocation — Make DurableClientContext implement AutoCloseable and have the Java worker call close() when the invocation ends
Share one client across all invocations — Use a static singleton so only one gRPC channel is ever created per worker process
changed the title [-]DurableClientContext.getClient() creates orphaned gRPC channels in Azure Functions[/-][+]DurableClientContext gRPC channels are never closed after function invocation[/+]on Jan 26, 2026
Activity
[-]DurableClientContext.getClient() creates orphaned gRPC channels in Azure Functions[/-][+]DurableClientContext gRPC channels are never closed after function invocation[/+]