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

Port bind skipped at server startup #19057

Closed
wtlucy opened this issue Oct 20, 2021 · 0 comments · Fixed by #19056
Closed

Port bind skipped at server startup #19057

wtlucy opened this issue Oct 20, 2021 · 0 comments · Fixed by #19056
Assignees
Labels
in:Transport release bug This bug is present in a released version of Open Liberty release:210012 team:Sirius

Comments

@wtlucy
Copy link
Contributor

wtlucy commented Oct 20, 2021

Describe the bug
In an extremely rare scenario, configured ports can silently fail to bind - preventing Liberty from using them. This issue is caused by a subtle race condition in the code responsible for delaying the port bind until the server is ready to handle traffic.

In the failing scenario, the port started message will not be emitted - for example the following message will be missing:

CWWKO0219I: TCP Channel defaultHttpEndpoint has been started and is now listening for requests on host *  (IPv4) port 9080.

and the following FFDC will be seen:

Exception = java.lang.RuntimeException
Source = com.ibm.ws.tcpchannel.internal.NBAcceptChannelSelector
probeid = 254
Stack Dump = java.lang.RuntimeException: java.nio.channels.NotYetBoundException
	at com.ibm.ws.tcpchannel.internal.NBAcceptChannelSelector.performRequest(NBAcceptChannelSelector.java:358)
	at com.ibm.ws.tcpchannel.internal.ChannelSelector.run(ChannelSelector.java:257)
	at java.base/java.lang.Thread.run(Thread.java:866)
Caused by: java.nio.channels.NotYetBoundException
	at java.base/sun.nio.ch.ServerSocketChannelImpl.begin(ServerSocketChannelImpl.java:246)
	at java.base/sun.nio.ch.ServerSocketChannelImpl.accept(ServerSocketChannelImpl.java:283)
	at com.ibm.ws.tcpchannel.internal.NBAcceptChannelSelector.performRequest(NBAcceptChannelSelector.java:278)
	... 2 more

Steps to Reproduce
Configure one or more ports to start, for example:

    <httpEndpoint id="defaultHttpEndpoint"
                  host="*"
                  httpPort="9080"
                  httpsPort="9443">
    </httpEndpoint>   

And start the server. In this scenario, one or more of the ports will silently fail to bind.

Expected behavior
All configured ports should start, or if there is a problem some meaningful error message should be logged.

Diagnostic information:

  • OpenLiberty Version: All
  • Affected feature(s) All
  • Java Version: reported on IBM Semeru Runtime Open Edition (11.0.12+7)
  • server.xml configuration: N/A, just need multiple ports
@wtlucy wtlucy added in:Transport release bug This bug is present in a released version of Open Liberty team:Sirius labels Oct 20, 2021
@wtlucy wtlucy self-assigned this Oct 20, 2021
@wtlucy wtlucy added this to General Issues in Web Tier Team via automation Oct 20, 2021
Web Tier Team automation moved this from General Issues to Completed Tasks Oct 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in:Transport release bug This bug is present in a released version of Open Liberty release:210012 team:Sirius
Projects
Web Tier Team
  
Completed Tasks
Development

Successfully merging a pull request may close this issue.

2 participants