You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by "Julien Vermillard (JIRA)" <ji...@apache.org> on 2005/12/26 14:23:30 UTC
[jira] Created: (DIRMINA-152) SO_REUSEADDR in 0.9 is gone ?
SO_REUSEADDR in 0.9 is gone ?
-----------------------------
Key: DIRMINA-152
URL: http://issues.apache.org/jira/browse/DIRMINA-152
Project: Directory MINA
Type: Bug
Versions: 0.9
Environment: in MINA 0.9 after a violent JVM shutdown (like Eclipse stop button) the TCP port aren't unbinded
Reporter: Julien Vermillard
look like 0.9 is not configuring TCP port for reusing
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Commented: (DIRMINA-152) SO_REUSEADDR in 0.9 is gone ?
Posted by "Trustin Lee (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/DIRMINA-152?page=comments#action_12363055 ]
Trustin Lee commented on DIRMINA-152:
-------------------------------------
I think the point of this issue is that you have to call setReuseAddress(true). JVM will unbind all ports automatically when it shuts down.
Please try again without the shutdown hook and let me know 'setReuseAddress(true)' solely resolves this issue. If so, I'll close this issue as 'won't fix'.
> SO_REUSEADDR in 0.9 is gone ?
> -----------------------------
>
> Key: DIRMINA-152
> URL: http://issues.apache.org/jira/browse/DIRMINA-152
> Project: Directory MINA
> Type: Bug
> Versions: 0.9
> Environment: in MINA 0.9 after a violent JVM shutdown (like Eclipse stop button) the TCP port aren't unbinded
> Reporter: Julien Vermillard
>
> look like 0.9 is not configuring TCP port for reusing
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Closed: (DIRMINA-152) SO_REUSEADDR in 0.9 is gone ?
Posted by "Julien Vermillard (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/DIRMINA-152?page=all ]
Julien Vermillard closed DIRMINA-152:
-------------------------------------
sorry for late testing.
It works with reuse address. We need to note it's not activated by default like in 0.8 for avoid double binding.
> SO_REUSEADDR in 0.9 is gone ?
> -----------------------------
>
> Key: DIRMINA-152
> URL: http://issues.apache.org/jira/browse/DIRMINA-152
> Project: Directory MINA
> Type: Bug
> Versions: 0.9
> Environment: in MINA 0.9 after a violent JVM shutdown (like Eclipse stop button) the TCP port aren't unbinded
> Reporter: Julien Vermillard
> Assignee: Trustin Lee
>
> look like 0.9 is not configuring TCP port for reusing
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Commented: (DIRMINA-152) SO_REUSEADDR in 0.9 is gone ?
Posted by "Julien Vermillard (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/DIRMINA-152?page=comments#action_12361599 ]
Julien Vermillard commented on DIRMINA-152:
-------------------------------------------
adding :
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {
cancelKeys();
}
});
att the end of the SocketAcceptorDelegate constructor should work ?
> SO_REUSEADDR in 0.9 is gone ?
> -----------------------------
>
> Key: DIRMINA-152
> URL: http://issues.apache.org/jira/browse/DIRMINA-152
> Project: Directory MINA
> Type: Bug
> Versions: 0.9
> Environment: in MINA 0.9 after a violent JVM shutdown (like Eclipse stop button) the TCP port aren't unbinded
> Reporter: Julien Vermillard
>
> look like 0.9 is not configuring TCP port for reusing
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Commented: (DIRMINA-152) SO_REUSEADDR in 0.9 is gone ?
Posted by "Trustin Lee (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/DIRMINA-152?page=comments#action_12361562 ]
Trustin Lee commented on DIRMINA-152:
-------------------------------------
Did you try to call SocketAcceptor.setReuseAddress(true) before you bind?
> SO_REUSEADDR in 0.9 is gone ?
> -----------------------------
>
> Key: DIRMINA-152
> URL: http://issues.apache.org/jira/browse/DIRMINA-152
> Project: Directory MINA
> Type: Bug
> Versions: 0.9
> Environment: in MINA 0.9 after a violent JVM shutdown (like Eclipse stop button) the TCP port aren't unbinded
> Reporter: Julien Vermillard
>
> look like 0.9 is not configuring TCP port for reusing
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Commented: (DIRMINA-152) SO_REUSEADDR in 0.9 is gone ?
Posted by "Alessandro Torrisi (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/DIRMINA-152?page=comments#action_12362121 ]
Alessandro Torrisi commented on DIRMINA-152:
--------------------------------------------
OK RESOLVED !
final ServiceRegistry registry = new JxHubServiceRegistry();
registry.getAcceptor(TransportType.SOCKET).setDisconnectClientsOnUnbind(true);
((SocketAcceptor)registry.getAcceptor(TransportType.SOCKET)).setReuseAddress(true);
Runtime.getRuntime().addShutdownHook(new Thread() {
// This method is called during shutdown
@Override
public void run() {
registry.unbindAll();
}
});
The line
((SocketAcceptor)registry.getAcceptor(TransportType.SOCKET)).setReuseAddress(true);
seems to resolve the issue ! Can you use TRUE by default ? Bye :D
> SO_REUSEADDR in 0.9 is gone ?
> -----------------------------
>
> Key: DIRMINA-152
> URL: http://issues.apache.org/jira/browse/DIRMINA-152
> Project: Directory MINA
> Type: Bug
> Versions: 0.9
> Environment: in MINA 0.9 after a violent JVM shutdown (like Eclipse stop button) the TCP port aren't unbinded
> Reporter: Julien Vermillard
>
> look like 0.9 is not configuring TCP port for reusing
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Commented: (DIRMINA-152) SO_REUSEADDR in 0.9 is gone ?
Posted by "Trustin Lee (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/DIRMINA-152?page=comments#action_12361596 ]
Trustin Lee commented on DIRMINA-152:
-------------------------------------
That's a good idea. I guess we can add ShutdownHook in IoAcceptor implementation.
As always, any patches are welcome! :)
> SO_REUSEADDR in 0.9 is gone ?
> -----------------------------
>
> Key: DIRMINA-152
> URL: http://issues.apache.org/jira/browse/DIRMINA-152
> Project: Directory MINA
> Type: Bug
> Versions: 0.9
> Environment: in MINA 0.9 after a violent JVM shutdown (like Eclipse stop button) the TCP port aren't unbinded
> Reporter: Julien Vermillard
>
> look like 0.9 is not configuring TCP port for reusing
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Commented: (DIRMINA-152) SO_REUSEADDR in 0.9 is gone ?
Posted by "Julien Vermillard (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/DIRMINA-152?page=comments#action_12361606 ]
Julien Vermillard commented on DIRMINA-152:
-------------------------------------------
it's not working, prolly because Workers are stoped
> SO_REUSEADDR in 0.9 is gone ?
> -----------------------------
>
> Key: DIRMINA-152
> URL: http://issues.apache.org/jira/browse/DIRMINA-152
> Project: Directory MINA
> Type: Bug
> Versions: 0.9
> Environment: in MINA 0.9 after a violent JVM shutdown (like Eclipse stop button) the TCP port aren't unbinded
> Reporter: Julien Vermillard
>
> look like 0.9 is not configuring TCP port for reusing
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Commented: (DIRMINA-152) SO_REUSEADDR in 0.9 is gone ?
Posted by "Julien Vermillard (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/DIRMINA-152?page=comments#action_12361594 ]
Julien Vermillard commented on DIRMINA-152:
-------------------------------------------
I added a shutdown hook for unbinding the service.
Perhaps it's something nice to have in SimpleRegistry no ?
> SO_REUSEADDR in 0.9 is gone ?
> -----------------------------
>
> Key: DIRMINA-152
> URL: http://issues.apache.org/jira/browse/DIRMINA-152
> Project: Directory MINA
> Type: Bug
> Versions: 0.9
> Environment: in MINA 0.9 after a violent JVM shutdown (like Eclipse stop button) the TCP port aren't unbinded
> Reporter: Julien Vermillard
>
> look like 0.9 is not configuring TCP port for reusing
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Commented: (DIRMINA-152) SO_REUSEADDR in 0.9 is gone ?
Posted by "Kaspar Luethi (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/DIRMINA-152?page=comments#action_12363341 ]
Kaspar Luethi commented on DIRMINA-152:
---------------------------------------
trustin, i can confirm that setReuseAddress(true) is sufficient to resolve the problem on red hat enterprise linux 4 with sun jvm 1.5.04. i did not have the problem on windows XP and suse linux 9.2.
why not set it to true by default?
> SO_REUSEADDR in 0.9 is gone ?
> -----------------------------
>
> Key: DIRMINA-152
> URL: http://issues.apache.org/jira/browse/DIRMINA-152
> Project: Directory MINA
> Type: Bug
> Versions: 0.9
> Environment: in MINA 0.9 after a violent JVM shutdown (like Eclipse stop button) the TCP port aren't unbinded
> Reporter: Julien Vermillard
>
> look like 0.9 is not configuring TCP port for reusing
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Commented: (DIRMINA-152) SO_REUSEADDR in 0.9 is gone ?
Posted by "Trustin Lee (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/DIRMINA-152?page=comments#action_12361591 ]
Trustin Lee commented on DIRMINA-152:
-------------------------------------
You can call SimpleServiceRegistry.getAcceptor() to get the actual acceptor instance. Please downcast it to SocketAcceptor, then you can set it.
I know this inconvenient. We're looking for the best way to configure this parameter.
In 0.8, there was no API to configure this kind of parameters, so I just enabled it by default. But mostly its default value of false because more than two instances can run at the same time accidently.
> SO_REUSEADDR in 0.9 is gone ?
> -----------------------------
>
> Key: DIRMINA-152
> URL: http://issues.apache.org/jira/browse/DIRMINA-152
> Project: Directory MINA
> Type: Bug
> Versions: 0.9
> Environment: in MINA 0.9 after a violent JVM shutdown (like Eclipse stop button) the TCP port aren't unbinded
> Reporter: Julien Vermillard
>
> look like 0.9 is not configuring TCP port for reusing
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Commented: (DIRMINA-152) SO_REUSEADDR in 0.9 is gone ?
Posted by "Niklas Therning (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/DIRMINA-152?page=comments#action_12361604 ]
Niklas Therning commented on DIRMINA-152:
-----------------------------------------
How about calling unbind() for all bound SocketAddresses in your shutdown hook instead?
> SO_REUSEADDR in 0.9 is gone ?
> -----------------------------
>
> Key: DIRMINA-152
> URL: http://issues.apache.org/jira/browse/DIRMINA-152
> Project: Directory MINA
> Type: Bug
> Versions: 0.9
> Environment: in MINA 0.9 after a violent JVM shutdown (like Eclipse stop button) the TCP port aren't unbinded
> Reporter: Julien Vermillard
>
> look like 0.9 is not configuring TCP port for reusing
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Commented: (DIRMINA-152) SO_REUSEADDR in 0.9 is gone ?
Posted by "Julien Vermillard (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/DIRMINA-152?page=comments#action_12361601 ]
Julien Vermillard commented on DIRMINA-152:
-------------------------------------------
well it's not working :)
> SO_REUSEADDR in 0.9 is gone ?
> -----------------------------
>
> Key: DIRMINA-152
> URL: http://issues.apache.org/jira/browse/DIRMINA-152
> Project: Directory MINA
> Type: Bug
> Versions: 0.9
> Environment: in MINA 0.9 after a violent JVM shutdown (like Eclipse stop button) the TCP port aren't unbinded
> Reporter: Julien Vermillard
>
> look like 0.9 is not configuring TCP port for reusing
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Commented: (DIRMINA-152) SO_REUSEADDR in 0.9 is gone ?
Posted by "Alessandro Torrisi (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/DIRMINA-152?page=comments#action_12362120 ]
Alessandro Torrisi commented on DIRMINA-152:
--------------------------------------------
I tryied :
final ServiceRegistry registry = new JxHubServiceRegistry();
registry.getAcceptor(TransportType.SOCKET).setDisconnectClientsOnUnbind(true);
Runtime.getRuntime().addShutdownHook(new Thread() {
// This method is called during shutdown
public void run() {
registry.unbindAll();
}
});
but...nothing..I can see on first CTRL+C all the clients disconnecting, but I have to wait about a minute before starting again !
> SO_REUSEADDR in 0.9 is gone ?
> -----------------------------
>
> Key: DIRMINA-152
> URL: http://issues.apache.org/jira/browse/DIRMINA-152
> Project: Directory MINA
> Type: Bug
> Versions: 0.9
> Environment: in MINA 0.9 after a violent JVM shutdown (like Eclipse stop button) the TCP port aren't unbinded
> Reporter: Julien Vermillard
>
> look like 0.9 is not configuring TCP port for reusing
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Commented: (DIRMINA-152) SO_REUSEADDR in 0.9 is gone ?
Posted by "Julien Vermillard (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/DIRMINA-152?page=comments#action_12361590 ]
Julien Vermillard commented on DIRMINA-152:
-------------------------------------------
I use the SimpleRegistry, so i think I can't test.
setReuseAddress(true) should be done by default as in 0.8 no ?
> SO_REUSEADDR in 0.9 is gone ?
> -----------------------------
>
> Key: DIRMINA-152
> URL: http://issues.apache.org/jira/browse/DIRMINA-152
> Project: Directory MINA
> Type: Bug
> Versions: 0.9
> Environment: in MINA 0.9 after a violent JVM shutdown (like Eclipse stop button) the TCP port aren't unbinded
> Reporter: Julien Vermillard
>
> look like 0.9 is not configuring TCP port for reusing
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Resolved: (DIRMINA-152) SO_REUSEADDR in 0.9 is gone ?
Posted by "Trustin Lee (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/DIRMINA-152?page=all ]
Trustin Lee resolved DIRMINA-152:
---------------------------------
Resolution: Won't Fix
Assign To: Trustin Lee
Thank you for clarification! Now I'll mark this issue as 'won't fix' because there's an easy workaround.
> SO_REUSEADDR in 0.9 is gone ?
> -----------------------------
>
> Key: DIRMINA-152
> URL: http://issues.apache.org/jira/browse/DIRMINA-152
> Project: Directory MINA
> Type: Bug
> Versions: 0.9
> Environment: in MINA 0.9 after a violent JVM shutdown (like Eclipse stop button) the TCP port aren't unbinded
> Reporter: Julien Vermillard
> Assignee: Trustin Lee
>
> look like 0.9 is not configuring TCP port for reusing
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Commented: (DIRMINA-152) SO_REUSEADDR in 0.9 is gone ?
Posted by "Alessandro Torrisi (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/DIRMINA-152?page=comments#action_12361257 ]
Alessandro Torrisi commented on DIRMINA-152:
--------------------------------------------
java.net.BindException: Address already in use
at sun.nio.ch.Net.bind(Native Method)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:119)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59)
at org.apache.mina.transport.socket.nio.support.SocketAcceptorDelegate.registerNew(SocketAcceptorDelegate.java:366)
at org.apache.mina.transport.socket.nio.support.SocketAcceptorDelegate.access$2(SocketAcceptorDelegate.java:330)
at org.apache.mina.transport.socket.nio.support.SocketAcceptorDelegate$Worker.run(SocketAcceptorDelegate.java:231)
I've got this problem ONLY UNDER UNIX (Mac Os X and Linux), while Windows Mina behaviour is correct, it shutdowns cleanly without any problem.
I experienced this problem with Mina 0.9.0 and Mina 0.91 snapshots.
> SO_REUSEADDR in 0.9 is gone ?
> -----------------------------
>
> Key: DIRMINA-152
> URL: http://issues.apache.org/jira/browse/DIRMINA-152
> Project: Directory MINA
> Type: Bug
> Versions: 0.9
> Environment: in MINA 0.9 after a violent JVM shutdown (like Eclipse stop button) the TCP port aren't unbinded
> Reporter: Julien Vermillard
>
> look like 0.9 is not configuring TCP port for reusing
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Commented: (DIRMINA-152) SO_REUSEADDR in 0.9 is gone ?
Posted by "Julien Vermillard (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/DIRMINA-152?page=comments#action_12361234 ]
Julien Vermillard commented on DIRMINA-152:
-------------------------------------------
java.net.BindException: Address already in use
at sun.nio.ch.Net.bind(Native Method)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:119)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59)
at org.apache.mina.transport.socket.nio.support.SocketAcceptorDelegate.registerNew(SocketAcceptorDelegate.java:366)
at org.apache.mina.transport.socket.nio.support.SocketAcceptorDelegate.access$2(SocketAcceptorDelegate.java:330)
at org.apache.mina.transport.socket.nio.support.SocketAcceptorDelegate$Worker.run(SocketAcceptorDelegate.java:231)
> SO_REUSEADDR in 0.9 is gone ?
> -----------------------------
>
> Key: DIRMINA-152
> URL: http://issues.apache.org/jira/browse/DIRMINA-152
> Project: Directory MINA
> Type: Bug
> Versions: 0.9
> Environment: in MINA 0.9 after a violent JVM shutdown (like Eclipse stop button) the TCP port aren't unbinded
> Reporter: Julien Vermillard
>
> look like 0.9 is not configuring TCP port for reusing
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira