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
The HTTP client have the following record to configure the IDLE based connection eviction:
publictypePoolConfigurationrecord {|# Max active connections per route(host:port). Default value is -1 which indicates unlimited.int maxActiveConnections =maxActiveConnections;
# Maximum number of idle connections allowed per pool.int maxIdleConnections =maxIdleConnections;
# Maximum amount of time (in seconds), the client should wait for an idle connection before it sends an error when the pool is exhausteddecimal waitTime =waitTime;
...# Minimum evictable time for an idle connection in seconds. Default value is 5 minutesdecimal minEvictableIdleTime =minEvictableIdleTime;
# Time between eviction runs in seconds. Default value is 30 secondsdecimal timeBetweenEvictionRuns =timeBetweenEvictionRuns;
...|};
But these options are not applied for the HTTP/2 connections. Currently HTTP/2 connections only support STALE based eviction(based on the GO_AWAY frames).
importballerina/http;
importballerina/lang.runtime;
http:PoolConfigurationpoolConfig= {
minEvictableIdleTime:5,
timeBetweenEvictionRuns:5
};
finalhttp:ClientclientEP=checknew ("http://localhost:9090/app", poolConfig=poolConfig);
publicfunction main() returnserror? {
http:Response_=checkclientEP->/api;
runtime:sleep(2);
http:Response_=checkclientEP->/api;
runtime:sleep(15);
// Expects a new connection to be made since the connection is IDLE for the configured timehttp:Response_=checkclientEP->/api;
}
Run the service and client files. Enable trace logs in the client side and you can notice that the same connection is used for the third request as well.
Version
Ballerina SwanLake Update 10(2201.10.0)
Environment Details (with versions)
No response
The text was updated successfully, but these errors were encountered:
Description
The HTTP client have the following record to configure the IDLE based connection eviction:
But these options are not applied for the HTTP/2 connections. Currently HTTP/2 connections only support STALE based eviction(based on the GO_AWAY frames).
Steps to Reproduce
Service:
Client:
Run the service and client files. Enable trace logs in the client side and you can notice that the same connection is used for the third request as well.
Version
Ballerina SwanLake Update 10(2201.10.0)
Environment Details (with versions)
No response
The text was updated successfully, but these errors were encountered: