-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KeepAliveStats doesn't register when connections are closed. #46
Comments
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
|
The result of SelectorThread.getKeepAliveStats().getCountConnections() never decreases when
connections are closed, so instead of returning the current number of open connections, it returns the
total number of connections over the full lifetime of the application.
From the implementation, it seems we are missing the logic to decrease the count:
public boolean trap(SelectionKey key){
if ( maxKeepAliveRequests == -1) return true;
Integer count = keepAliveCounts.get(key);
if ( count == null ){
count = 0;
if (keepAliveStats != null)
{ keepAliveStats.incrementCountConnections(); }
}
if ((count++) > maxKeepAliveRequests){
if (keepAliveStats != null)
{ keepAliveStats.incrementCountRefusals(); }
return false;
}
keepAliveCounts.put(key, count);
if (keepAliveStats != null)
{ keepAliveStats.incrementCountHits(); }
return true;
}
/**
*/
public void untrap(SelectionKey key) { if ( maxKeepAliveRequests == -1) return; keepAliveCounts.remove(key); }
Inside the untrap(..), we must decrease the count. Can you file a bug here:
Environment
Operating System: All
Platform: All
Affected Versions
[1.9.22]
The text was updated successfully, but these errors were encountered: