Today when the Dapr app channel HTTP client is created in the Dapr runtime, its not setting a default idle connection timeout property, meaning that the zero value is being set which allows for no limit on the amount of time a connection can remain idle before closing: https://cs.opensource.google/go/go/+/refs/tags/go1.22.4:src/net/http/transport.go;l=221
See the transport object being created in Dapr here which is overwriting any sane defaults set by go.
Service invocation between two apps with the invokee app server setting a low (~10 ms) HTTP connection keep-alive value. By constantly invoking the app, you can see various instances of the following errors: " err: rpc error: code = Internal desc = error invoking app channel":
use of closed network connection
http: server closed idle connection
EOF
By setting a idleConnectionTimeout value in the app channel, this will allow the user to configure their invokee app to set the idle-connection/keep-alive timeout higher than that of Dapr's.
Release Note
RELEASE NOTE: FIX set idle connection timeout in HTTP app channel.
In what area(s)?
/area runtime
What version of Dapr?
1.13.4
Actual Behavior
Today when the Dapr app channel HTTP client is created in the Dapr runtime, its not setting a default idle connection timeout property, meaning that the zero value is being set which allows for no limit on the amount of time a connection can remain idle before closing: https://cs.opensource.google/go/go/+/refs/tags/go1.22.4:src/net/http/transport.go;l=221
See the transport object being created in Dapr here which is overwriting any sane defaults set by go.
Expected Behavior
The
IdleConnTimeout
property should be set so that idle connections are closed eventually. Maybe using the default of 90 seconds set by go: https://cs.opensource.google/go/go/+/refs/tags/go1.22.4:src/net/http/transport.go;l=43Steps to Reproduce the Problem
Service invocation between two apps with the invokee app server setting a low (~10 ms) HTTP connection keep-alive value. By constantly invoking the app, you can see various instances of the following errors: " err: rpc error: code = Internal desc = error invoking app channel":
By setting a idleConnectionTimeout value in the app channel, this will allow the user to configure their invokee app to set the idle-connection/keep-alive timeout higher than that of Dapr's.
Release Note
RELEASE NOTE: FIX set idle connection timeout in HTTP app channel.