Skip to content
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

Closed
glassfishrobot opened this issue Jan 28, 2008 · 8 comments
Closed

Comments

@glassfishrobot
Copy link

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;
}
/**

  • Stop monitoring keep-alive request count for the given connection.
    */
    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]

@glassfishrobot
Copy link
Author

@glassfishrobot Commented
Reported by speck@java.net

@glassfishrobot
Copy link
Author

@glassfishrobot Commented
Was assigned to jfarcand@java.net

@glassfishrobot
Copy link
Author

@glassfishrobot Commented
jfarcand@java.net said:
Fixed

@glassfishrobot
Copy link
Author

@glassfishrobot Commented
jfarcand@java.net said:
Don't know why I've added fixed in comments, but left the bug open

@glassfishrobot
Copy link
Author

@glassfishrobot Commented
jfarcand@java.net said:
Fix milestones

@glassfishrobot
Copy link
Author

@glassfishrobot Commented
Marked as fixed on Wednesday, December 16th 2009, 6:14:16 pm

@glassfishrobot
Copy link
Author

@glassfishrobot Commented
This issue was imported from java.net JIRA GRIZZLY-46

@glassfishrobot
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant