Page MenuHomePhabricator

Fix Gearman plugin for Jenkins to 2.319.1
Closed, ResolvedPublic

Description

The latest Jenkins LTS disposes of the term master for the main node, from the release notes:

Replace the term "master" for the main Jenkins application with "controller" or "built-in node" in user interface strings and documentation. New installations get the new node and label immediately. Existing installations do not change the node name (e.g. NODE_NAME environment variable) or label of the built-in node until an administrator explicitly performs the migration. If a job definition, Pipeline definition, or tool installer reference must be tied to the built-in node, it should use the label "built-in". (Upgrade guide - Built-In Node Name and Label Migration)

And in the web UI of release-jenkins the following note is displayed:

The word "master" is being retired as the term for the main Jenkins process and the built-in node. The main process is now called "controller" and the built-in node is called just "built-in node". The UI has been updated with these changes. The following features are also affected:

  • The implicit label of the built-in node changes from master to built-in.
  • The built-in node's NODE_NAME environment variable also changes from master to built-in.

These changes could affect build behavior, so are not applied automatically. Before you apply these changes, you should do the following:

Review label assignments in job configurations and tool installers for uses of master label. Any such label assignments will not match the built-in node after migration. Besides updating these assignments, you could also explicitly add the master label to the built-in node.
Review use of the NODE_NAME environment variable in build scripts.

For the CI Jenkins, that might well affect the Gearman plugin which comes hardcoded with the term master in its code :-\

Event Timeline

I have send a commit test the plugin at https://github.com/jenkinsci/gearman-plugin/ with Jenkins 2.139 and the tests fail https://ci.jenkins.io/blue/organizations/jenkins/Plugins%2Fgearman-plugin/detail/jenkins-2.139/1/tests

There is an existing issue related to SaveableListener which kicks in while extensions are still being loaded (eg when Gearman has been loaded and an extension loading write to an XML file). That causes a circular dependency of some sort https://issues.jenkins.io/browse/JENKINS-54888

We gotta replace master with built-in in the gearman plugin.

And running mvn release:

[INFO] --- spotbugs-maven-plugin:4.2.3:check (spotbugs) @ gearman-plugin ---
[INFO] BugInstance size is 5
[INFO] Error size is 0
[INFO] Total bugs: 5

[ERROR] Medium: Inconsistent synchronization of hudson.plugins.gearman.AbstractWorkerThread.conn; locked 50% of time [hudson.plugins.gearman.AbstractWorkerThread, hudson.plugins.gearman.AbstractWorkerThread] Unsynchronized access at AbstractWorkerThread.java:[line 163]Synchronized access at AbstractWorkerThread.java:[line 64] IS2_INCONSISTENT_SYNC
[ERROR] Medium: Possible null pointer dereference in new hudson.plugins.gearman.GearmanProxy() due to return value of called method [hudson.plugins.gearman.GearmanProxy, hudson.plugins.gearman.GearmanProxy] Dereferenced at GearmanProxy.java:[line 74]Known null at GearmanProxy.java:[line 73] NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE
[ERROR] Medium: Possible null pointer dereference in hudson.plugins.gearman.GearmanProxy.onBuildFinalized(Run) due to return value of called method [hudson.plugins.gearman.GearmanProxy, hudson.plugins.gearman.GearmanProxy] Dereferenced at GearmanProxy.java:[line 285]Known null at GearmanProxy.java:[line 285] NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE
[ERROR] Medium: Exceptional return value of java.util.concurrent.ExecutorService.submit(Callable) ignored in hudson.plugins.gearman.MyGearmanWorkerImpl.submitFunction(GearmanFunction) [hudson.plugins.gearman.MyGearmanWorkerImpl] At MyGearmanWorkerImpl.java:[line 637] RV_RETURN_VALUE_IGNORED_BAD_PRACTICE
[ERROR] Medium: Useless object stored in variable newFunctionMap of method hudson.plugins.gearman.OneOffExecutorWorkerThread.registerJobs() [hudson.plugins.gearman.OneOffExecutorWorkerThread] At OneOffExecutorWorkerThread.java:[line 48] UC_USELESS_OBJECT

Which is not caught in the CI build for some reason :(

I have ignored the above spotbugs issues when doing the release. The tag has been uploaded and I crafted the release notes: https://github.com/jenkinsci/gearman-plugin/releases/tag/gearman-plugin-0.6.0 The artifact has been uploaded https://repo.jenkins-ci.org/ui/packages/gav:%2F%2Forg.jenkins-ci.plugins:gearman-plugin/0.6.0

The upstream doc to release is https://www.jenkins.io/doc/developer/publishing/releasing-manually/ and I have amended our documentation https://wikitech.wikimedia.org/wiki/Jenkins#Jenkins_plugin

https://plugins.jenkins.io/gearman-plugin/ is not updated for some reason, will check again later, maybe there is some delay.

The plugin shows up in the update center, I have tested it locally with Jenkins 2.239.1 (./mvnw hpi:run with an agent, a freestyle job and a pipeline job). Seems good enough and I am claiming that one fixed in the interest of unblocking the parent task to upgrade the CI Jenkins.

hashar renamed this task from Upgrade CI Jenkins to 2.319.1 to Fix Gearman plugin for Jenkins to 2.319.1.Jan 11 2022, 10:19 PM
hashar closed this task as Resolved.
hashar claimed this task.