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

[JENKINS-57965] Prevent save of KubernetesSlave through UI #514

Merged
merged 8 commits into from Jul 2, 2019

Conversation

Vlatombe
Copy link
Member

No description provided.

@jglick
Copy link
Member

jglick commented Jun 18, 2019

Not sure if test timeouts are flakes or not. I did notice this which might be related:

java.lang.NullPointerException
	at hudson.model.Node.toComputer(Node.java:208)
	at hudson.model.Slave.getComputer(Slave.java:539)
	at org.csanchez.jenkins.plugins.kubernetes.KubernetesLauncher.launch(KubernetesLauncher.java:144)
	at hudson.slaves.SlaveComputer$1.call(SlaveComputer.java:294)
	at …

@Vlatombe
Copy link
Member Author

I looked at the failure, and what I understood is the following:

  • Jenkins is being shut down
  • The Kubernetes launcher was still running and throws a NPE because Jenkins singleton is now null. Ideally we'd need to interrupt the launcher thread upon shutdown?
  • The timeout seems to be caused by a serie of remoting calls which execute serially (each thread is trying to lock the Queue), and the one holding the lock is waiting on a remoting call.

@Vlatombe Vlatombe requested a review from jglick July 2, 2019 13:19
Copy link
Member

@jglick jglick left a comment

Choose a reason for hiding this comment

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

If you want to write a functional test for it, use

  • JenkinsRule.createDummySecurityRealm + MockAuthorizationStrategy (actually not even necessary since you are denying permission even to admins)
  • JenkinsRule.WebClient.goTo or similar overloads

public boolean hasPermission(Authentication a, Permission permission) {
if (permission== Computer.CONFIGURE)
return false;
return base.hasPermission(a,permission);
Copy link
Member

Choose a reason for hiding this comment

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

nonstandard formatting these three lines, FYI

@Vlatombe Vlatombe merged commit e5a99af into jenkinsci:master Jul 2, 2019
@Vlatombe Vlatombe deleted the JENKINS-57965 branch July 2, 2019 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants