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
GWT version: 2.11 Browser (with version): any Operating System: Linux/Mac (have not tested Windows
Description
The JettyLauncher has a specific flag passed to Jetty to ensure that SO_REUSEADDR is set, but the SDM code server explicitly disables this, for reasons that are unclear to me. This flag allows a port that was recently used and the browser hasn't yet stopped connecting to to be reused by a new process.
Steps to reproduce
Start any GWT sample with SDM, for example ant devmode in the Hello sample
Open a browser and connect, wait for the page to load
Stop SDM, and quickly start it again - as if some class had changed and we needed a new process to replace it.
Expected: SDM starts right away, and a browser can connect
Actual: SDM fails on startup with an error:
[java] java.io.IOException: Failed to bind to /127.0.0.1:9876
[java] at org.eclipse.jetty.server.ServerConnector.openAcceptChannel(ServerConnector.java:349)
[java] at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:310)
[java] at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80)
[java] at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:234)
[java] at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73)
[java] at org.eclipse.jetty.server.Server.doStart(Server.java:401)
[java] at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73)
[java] at com.google.gwt.dev.codeserver.WebServer.start(WebServer.java:138)
[java] at com.google.gwt.dev.codeserver.CodeServer.start(CodeServer.java:162)
[java] at com.google.gwt.dev.codeserver.CodeServer.main(CodeServer.java:104)
[java] at com.google.gwt.dev.codeserver.CodeServer.main(CodeServer.java:55)
[java] at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
[java] at java.base/java.lang.reflect.Method.invoke(Method.java:580)
[java] at com.google.gwt.dev.shell.SuperDevListener.runCodeServer(SuperDevListener.java:112)
[java] at com.google.gwt.dev.shell.SuperDevListener.start(SuperDevListener.java:91)
[java] at com.google.gwt.dev.DevMode.ensureCodeServerListener(DevMode.java:666)
[java] at com.google.gwt.dev.DevModeBase.doStartup(DevModeBase.java:785)
[java] at com.google.gwt.dev.DevMode.doStartup(DevMode.java:551)
[java] at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:888)
[java] at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:705)
[java] at com.google.gwt.dev.DevMode.main(DevMode.java:432)
[java] Caused by: java.net.BindException: Address already in use
[java] at java.base/sun.nio.ch.Net.bind0(Native Method)
[java] at java.base/sun.nio.ch.Net.bind(Net.java:565)
[java] at java.base/sun.nio.ch.ServerSocketChannelImpl.netBind(ServerSocketChannelImpl.java:344)
[java] at java.base/sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:301)
[java] at java.base/sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:89)
[java] at org.eclipse.jetty.server.ServerConnector.openAcceptChannel(ServerConnector.java:344)
[java] ... 20 more
Known workarounds
Stop the browser, so that it releases its end of the socket connection, which will free up the port, or wait long enough for the connection to time out.
GWT version: 2.11
Browser (with version): any
Operating System: Linux/Mac (have not tested Windows
Description
The JettyLauncher has a specific flag passed to Jetty to ensure that
SO_REUSEADDR
is set, but the SDM code server explicitly disables this, for reasons that are unclear to me. This flag allows a port that was recently used and the browser hasn't yet stopped connecting to to be reused by a new process.Steps to reproduce
ant devmode
in the Hello sampleExpected: SDM starts right away, and a browser can connect
Actual: SDM fails on startup with an error:
Known workarounds
Stop the browser, so that it releases its end of the socket connection, which will free up the port, or wait long enough for the connection to time out.
Links to further discussions
See https://stackoverflow.com/a/3233022/860630 for a good summary of what
SO_REUSEADDR
does, why it makes sense here.The text was updated successfully, but these errors were encountered: