Croway commented on PR #29692:
URL: https://github.com/apache/camel/pull/29692#issuecomment-6821816882

   Not from this PR, but it is on the path this PR enables: the occupier only 
ever occupies the **first** node of its plan.
   
   `etc/scripts/jenkins-alt-arch-nodes.groovy:116` parses the Python output 
with `output.eachLine { line -> ... }`. `String.eachLine` is not 
CPS-transformed, so it runs the pipeline closure for the first line and stops 
([CPS method 
mismatches](https://www.jenkins.io/doc/book/pipeline/cps-method-mismatches/)). 
Occupier builds #1 and #2 on ci-builds log the warning:
   
   ```
   expected to call java.lang.String.eachLine but wound up catching 
org.jenkinsci.plugins.workflow.cps.CpsClosure2.call; see: 
https://jenkins.io/redirect/pipeline-cps-method-mismatches/
   Idle executors to occupy: [[platform:ppc64le, node:jenkins-osu-power9-1, 
idleExecutors:1]]
   ```
   
   Both runs planned only one node, so nothing was lost there yet. With two 
qualifying nodes (ppc64le and s390x both running Camel Core with idle 
executors, or two agents of one platform), the second one is dropped. I copied 
lines 115-122 verbatim into a sandboxed pipeline on a local Jenkins (2.580.2, 
workflow-cps 4403) and fed it the two-line output the Python prints:
   
   ```
   python output lines: 2
   expected to call java.lang.String.eachLine but wound up catching 
org.jenkinsci.plugins.workflow.cps.CpsClosure2.call; ...
   CURRENT plan: [[platform:ppc64le, node:jenkins-osu-power9-1, 
idleExecutors:1]]
   FIXED   plan: [[platform:ppc64le, node:jenkins-osu-power9-1, 
idleExecutors:1], [platform:s390x, node:jenkins-s390x-3, idleExecutors:2]]
   ```
   
   Fix: a plain loop. `String.split` is already used in the file and needs no 
sandbox approval:
   
   ```groovy
   for (String line : output.split('\n')) {
       def parts = line.split('\t')
       if (parts.length == 3) {
           plan << [platform: parts[0], node: parts[1], idleExecutors: parts[2] 
as int]
       }
   }
   ```
   
   _Claude Code on behalf of Croway_
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to