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

added portOffset attribute to server.xml per BZ-61171 #63

Closed
wants to merge 1 commit into from

Conversation

isapir
Copy link
Member

@isapir isapir commented Jun 10, 2017

@ghost
Copy link

ghost commented Jun 10, 2017

i feel it's not very necessary for tomcat.What if the port is already bound?

@markt-asf
Copy link
Contributor

I think more discussion is required on how to approach this. Specifically, when should the offset be applied? What is the impact on getters and setters? For example connector.setPort (getPort ()) should be a NO-OP. What is reported via JMX? There are all sorts of side effects that need to be thought through here else we'll end up creating some very non-intuative behaviour.

@isapir
Copy link
Member Author

isapir commented Jun 10, 2017

I think more discussion is required on how to approach this. Specifically, when should the offset be applied?

@markt-asf I agree, and I was trying to find different options for this in order to initiate a discussion, but the way that Tomcat reads the config files and initializes objects via introspection really limits us here unless there is a major overhaul.

The process is somewhat like this:

  1. Connectors are initialized (no reference to Service or Server)
  2. Service is linked to the Connectors (still no reference to Server)
  3. Server is added to Service

Point (3) is point where I took the portOffset from Server and applied it to the Connectors.

What is the impact on getters and setters? For example connector.setPort (getPort ()) should be a NO-OP.

At point (1) above the Connector's setPort() is called by the IntrospectionUtils with the values from server.xml. That can not be a NO-OP at that point as that would practically disable the Connector, but we can check if Service and Server are null or not (which they are at initialization) and perhaps do something different accordingly?

Is it even possible/allowed to change the port after initialization?

@markt-asf
Copy link
Contributor

I've added some comments to the bugzilla issue on how this might be addressed.

@isapir
Copy link
Member Author

isapir commented Oct 13, 2017

Great, I will implement as advised on BZ.

@gmcdonald gmcdonald closed this Feb 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants