[jboss-jira] [JBoss JIRA] Commented: (JGRP-883) Use of Math.min In GossipRouter's Socket Linger Code Causes Unexpected Results
Jimmy Wilson (JIRA)
jira-events at lists.jboss.org
Tue Jan 6 15:59:04 EST 2009
[ https://jira.jboss.org/jira/browse/JGRP-883?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12445074#action_12445074 ]
Jimmy Wilson commented on JGRP-883:
-----------------------------------
This same code is in branches 2.4, 2.6, and 2.7 as well as HEAD, but currently it isn't clear if there will be another 2.7 release as I can't select that as a fix version.
> Use of Math.min In GossipRouter's Socket Linger Code Causes Unexpected Results
> ------------------------------------------------------------------------------
>
> Key: JGRP-883
> URL: https://jira.jboss.org/jira/browse/JGRP-883
> Project: JGroups
> Issue Type: Bug
> Affects Versions: 2.4.4, 2.5.2, 2.6.7, 2.7
> Reporter: Jimmy Wilson
> Assignee: Jimmy Wilson
> Fix For: 2.4.5, 2.6.8, 2.8
>
>
> From 2.6.7 Gossip Router Code:
> /** Time (in millis) for setting SO_LINGER on sockets returned from accept(). 0 means don't set SO_LINGER */
> private long linger_timeout=2000L;
> ...snip...
> if(linger_timeout > 0) {
> int linger=Math.min(1, (int)(linger_timeout / 1000));
> sock.setSoLinger(true, linger);
> }
> This means that the socket linger timeout will always be 1 regardless of what you set exception when a millisecond value of less than one second is specified which isn't valid for a socket linger timeout anyway. Math.max should likely be used instead.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list