Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-52070

Illegal reflective access by org.jenkinsci.utils.process.ProcessUtils to field java.lang.ProcessImpl#pid

    XMLWordPrintable

Details

    Description

      The ProcessUtils in lib-process-utils allows getting PID from a process using reflection. As part of the general Java 9/10/11 hackathon all setAccessible reflection use was being reviewed.

       

      This issue is to remove the reflection use, and as a nice side effect the code will work on Windows too. However, this requires upgrading to Java 9+, so I don't really expect it to happen anytime soon. For now I wanted to preserve the little bit of work I did.

      Attachments

        Activity

          jonahgraham Jonah Graham created issue -
          jonahgraham Jonah Graham made changes -
          Field Original Value New Value
          Epic Link JENKINS-40689 [ 177392 ]
          jonahgraham Jonah Graham made changes -
          Remote Link This issue links to "https://github.com/jenkinsci/lib-process-utils/pull/2 (Web Link)" [ 20911 ]
          oleg_nenashev Oleg Nenashev added a comment -

          It seems the current code is not going to work on Java 9+, right?

          oleg_nenashev Oleg Nenashev added a comment - It seems the current code is not going to work on Java 9+, right?
          oleg_nenashev Oleg Nenashev made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          oleg_nenashev Oleg Nenashev made changes -
          Status In Progress [ 3 ] In Review [ 10005 ]
          jonahgraham Jonah Graham added a comment -

          It works in Java9+ so far, just gives the standard warning:

          WARNING: Illegal reflective access by org.jenkinsci.utils.process.ProcessUtils (file:/scratch/jenkins/git/lib-process-utils/target/classes/) to field java.lang.ProcessImpl.pid

           

           

          jonahgraham Jonah Graham added a comment - It works in Java9+ so far, just gives the standard warning: WARNING: Illegal reflective access by org.jenkinsci.utils.process.ProcessUtils ( file:/scratch/jenkins/git/lib-process-utils/target/classes/ ) to field java.lang.ProcessImpl.pid    
          oleg_nenashev Oleg Nenashev made changes -
          Labels java10_hackathon
          ndeloof Nicolas De Loof made changes -
          Remote Link This issue links to "convert to multi-release JAR (Web Link)" [ 20924 ]
          oleg_nenashev Oleg Nenashev added a comment -

          Maven Compile r3.8.0 supports Multi-release JARs, so maybe we need another PR

          oleg_nenashev Oleg Nenashev added a comment - Maven Compile r3.8.0 supports Multi-release JARs, so maybe we need another PR
          oleg_nenashev Oleg Nenashev made changes -
          Labels java10_hackathon java10_hackathon java11
          batmat Baptiste Mathus made changes -
          Labels java10_hackathon java11 java10_hackathon java11 triaged
          markewaite Mark Waite added a comment -

          As far as I can tell, the process-utils package that is provided by the lib-process-utils GitHub repository is only used in the acceptance test harness and in the docker-fixtures library. Once we've switched to require Java 11, the library can use the Java 11 ProcessHandle class to return the process ID of the current process.

          There is no reference to the process-utils package in Jenkins core or in any of the 1500+ plugins that I searched.

          markewaite Mark Waite added a comment - As far as I can tell, the process-utils package that is provided by the lib-process-utils GitHub repository is only used in the acceptance test harness and in the docker-fixtures library . Once we've switched to require Java 11, the library can use the Java 11 ProcessHandle class to return the process ID of the current process. There is no reference to the process-utils package in Jenkins core or in any of the 1500+ plugins that I searched.
          markewaite Mark Waite made changes -
          Status In Review [ 10005 ] In Progress [ 3 ]
          markewaite Mark Waite made changes -
          Status In Progress [ 3 ] Open [ 1 ]
          basil Basil Crow made changes -
          Epic Link JENKINS-40689 [ 177392 ] JENKINS-67688 [ 214193 ]
          basil Basil Crow made changes -
          Labels java10_hackathon java11 triaged java11
          basil Basil Crow made changes -
          Assignee Jonah Graham [ jonahgraham ]
          basil Basil Crow made changes -
          Component/s other [ 15490 ]
          Component/s core [ 15593 ]
          basil Basil Crow made changes -
          Summary remove reflection and support Windows in lib-process-utils for getting PID Illegal reflective access by org.jenkinsci.utils.process.ProcessUtils to field java.lang.ProcessImpl#pid
          basil Basil Crow made changes -
          Epic Link JENKINS-67688 [ 214193 ] JENKINS-67907 [ 214454 ]
          basil Basil Crow made changes -
          Issue Type Improvement [ 4 ] Bug [ 1 ]

          People

            Unassigned Unassigned
            jonahgraham Jonah Graham
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: