Optimize JnlpAgentReceiver to use O(1) cache lookup - #27231
Closed
aryawadhwa wants to merge 4 commits into
Closed
Conversation
… rotation - Use static SECURE_RANDOM field in Slave to avoid DMI_RANDOM_USED_ONLY_ONCE - Replace vacuous instanceof Slave checks with null-checks in SlaveComputer.getJnlpMac() and doRevokeInboundSecret() (BC_VACUOUS_INSTANCEOF) - Add 3 additional tests: unique salt per agent, HTTP revoke endpoint, backward-compat fallback for agents without a salt
Signed-off-by: aryawadhwa <aryawadhwa2@gmail.com>
Contributor
|
I'm not persuaded that this is valuable enough to justify the added complexity. Even with hundreds of nodes, the lookup time will be indistinguishable between a linear lookup and a hashed lookup. The pull request includes unrelated changes that must be removed. It is probably best to raise an issue in the issue tracker and describe the problem that you're trying to solve. Provide examples of the measurements that you've used to confirm there is a problem. Closing because it includes unrelated changes and needs more discussion before it is implemented. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR optimizes the node lookup in$O(N)$ linear search over all nodes to an $O(1)$ lookup using
JnlpAgentReceiverfor inbound agents. It changes anJenkins.get().getComputer(clientName). This improves performance when a large number of nodes are connected.This is a follow-up optimization to the inbound agent secret rotation changes.
Testing done
mvn testin thejenkins/slavesmodule to ensure no regressions in JNLP receiver logic.Proposed changelog entries
Proposed changelog category
/label rfe
Proposed upgrade guidelines
N/A
Submitter checklist
@Restrictedor have@since TODOJavadocs, as appropriate.@Deprecated(since = "TODO")or@Deprecated(forRemoval = true, since = "TODO"), if applicable.Desired reviewers
@MarkEWaite