Skip to content

Conversation

onobc
Copy link
Contributor

@onobc onobc commented Dec 28, 2019

Moves all thread related server properties under a "threads" group for each server implementation that has thread related properties (tomcat|jetty|undertow).

The existing property accessors have been marked as deprecated. The old impl just delegates to the new one which allows us to test that fact in a deprecated test and then all subsequent downstream tests can rely on the new api (ie have deprecate test in a single place for each property).

@snicoll do the Boot docs get auto-generated from the @DeprecatedConfigurationPropertys?

Closes gh-18620

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Dec 28, 2019
@DeprecatedConfigurationProperty(replacement = "server.jetty.acceptors")
public Integer getAcceptors() {
return this.acceptors;
return this.getThreads().getAcceptors();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

A bit of inconsistency on naming and plurality between Jetty#acceptors/selectors and Undertow#io/worker. Should we
a) move acceptors -> acceptor
b) move io -> ios
c) include num- prefix in all of them?
d) leave alone - not a big deal

Copy link
Member

@snicoll snicoll left a comment

Choose a reason for hiding this comment

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

Thanks a lot for the PR @Bono007. It's quite complete and looking at the proposal, I am wondering if threads is the best name for the group. I've added a few comments and would like to hear from the team before going forward with this one.

/**
* Thread related configuration.
*/
private final Threads threads = new Threads();
Copy link
Member

Choose a reason for hiding this comment

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

Looking at the code I am wondering now if pool wouldn't be better and more consistent with other properties of the same nature.

@Bono007 no need to act on that now, I'd like to get some more feedback before asking you to change anything.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Its interesting because both concepts are related but not exclusive of one another. Some servers may not have pool properties, some may have thread properties that are unrelated to pool, etc.

I think threads is more generic than pool and most developers will associate that w/ the current thread related properties they are used to.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After thinking about this some more, suppose I were to add another maxQueueDepth property to Jetty, this would not make sense under threads but would make sense under pool.

}

@Deprecated
@DeprecatedConfigurationProperty(replacement = "server.jetty.acceptors")
Copy link
Member

Choose a reason for hiding this comment

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

That replacement value is wrong.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch. Updated.

@snicoll Boot MR question... Should I rebase and squash subsequent commits to MR based on feedback (like this case) or just add more commits and let Github squash at end of MR?

Copy link
Member

Choose a reason for hiding this comment

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

Not a single answer here. When it's about fixing a PR review (as you did), we prefer a single squashed commit rebased on top of the latest state of the target branch (here master). When there is a discussion and you'd like to suggest something, a separate commit is better in case we don't pursue with the suggestion.

}

@Deprecated
@DeprecatedConfigurationProperty(replacement = "server.jetty.selectors")
Copy link
Member

Choose a reason for hiding this comment

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

That replacement value is wrong.

* Number of I/O threads to create for the worker. The default is derived from
* the number of available processors.
*/
private Integer io;
Copy link
Member

Choose a reason for hiding this comment

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

io is a bit odd on its own. I don't have bright ideas but perhaps we should add something in the property name that better conveys it's a number of threads for a certain "type" of threads.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep I struggled w/ this balance of brevity and better conveyed meaning. For this one I was thinking io-per-worker as that is actually what it is.

@snicoll snicoll added type: enhancement A general enhancement for: team-attention An issue we'd like other members of the team to review and removed status: waiting-for-triage An issue we've not yet triaged labels Dec 30, 2019
@snicoll snicoll added this to the 2.3.x milestone Dec 30, 2019
@philwebb philwebb removed the for: team-attention An issue we'd like other members of the team to review label Jan 16, 2020
@snicoll
Copy link
Member

snicoll commented Feb 14, 2020

@Bono007 now that your other PR has been merged, would you be willing to rebase your proposal and include the max-queue-capacity property that has been introduced for Jetty?

@snicoll snicoll added the status: waiting-for-feedback We need additional information before we can continue label Feb 14, 2020
@onobc
Copy link
Contributor Author

onobc commented Feb 14, 2020 via email

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Feb 14, 2020
assertThat(this.properties.getJetty().getThreads().getMaxQueueCapacity()).isEqualTo(5150);
}

@Deprecated
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Has this been released anywhere yet? If not, I can remove it - just let me know.

@onobc
Copy link
Contributor Author

onobc commented Feb 15, 2020

@snicoll there were a few comments in the original proposal that we never resolved. I am ok with the proposal as is - if you want anything changed just let me know.

@snicoll snicoll changed the title Add 'threads' group under server properties Add 'threads' configuration group for embedded containers Mar 19, 2020
@snicoll snicoll removed the status: feedback-provided Feedback has been provided label Mar 19, 2020
@snicoll snicoll modified the milestones: 2.3.x, 2.3.0.M4 Mar 19, 2020
@snicoll snicoll self-assigned this Mar 19, 2020
@snicoll snicoll closed this in 7014cc5 Mar 19, 2020
@snicoll
Copy link
Member

snicoll commented Mar 19, 2020

Thanks again @Bono007

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Regroup thread-related server properties under groups
5 participants