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

[WFLY-2345] Port Offset 0 does not work #5307

Closed
wants to merge 1 commit into from

Conversation

marschall
Copy link
Contributor

When a port offset is specified in the socket binding group and the
socket binding has a port of 0, then the port offset is not used to
calculate the port instead port 0 is bound.

This pull request contains three changes:

  • fix SocketBinding to also do offset calculation when the port is 0
  • extend ControllerInitializer to allow specifing the port offset
  • add a test in OtherServicesSubsystemTestCase

Issue: WFLY-2345
https://issues.jboss.org/browse/WFLY-2345

When a port offset is specified in the socket binding group and the
socket binding has a port of 0, then the port offset is not used to
calculate the port instead port 0 is bound.

This pull request contains three changes:

 - fix `SocketBinding` to also do offset calculation when the port is 0

 - extend `ControllerInitializer` to allow specifing the port offset

 - add a test in `OtherServicesSubsystemTestCase`

Issue: WFLY-2345
https://issues.jboss.org/browse/WFLY-2345
@wildfly-ci
Copy link

Build 1133 is now running using a merge of 8eeb6d6

@wildfly-ci
Copy link

Build 1133 outcome was SUCCESS using a merge of 8eeb6d6
Summary: Tests passed: 5134, ignored: 90 Build time: 1:37:34

@@ -111,7 +111,7 @@ public SocketBindingManager getSocketBindings() {

private int calculatePort() {
int port = this.port;
if (port > 0 && isFixedPort == false) {
if (!isFixedPort) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps port <= 0 would be better?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if it ever can be negative. The model/schema should validate that's in a valid range.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is ok, port 0 is valid, negative ones are not.

@bstansberry
Copy link
Contributor

Merged. Thanks!

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