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

Workspace locking mechanism should ignore file separator variants when acquiring lock for absolute path

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • core
    • None
    • Jenkins ver. 2.89.2
      Windows (as slave)

      Steps to reproduce:
      1. create pipeline with script for windows node

      node('windows') {
        ws('D:\\workspaces\\ws') {
          ws('D:\\workspaces/ws') {
          }
        }
      }
      

      2. run pipeline

      Expected output:

      [Pipeline] ws
      Running in D:\workspaces\ws
      [Pipeline] {
      [Pipeline] ws
      Running in D:\workspaces\ws@2
      

      Actual output:

      [Pipeline] ws
      Running in D:\workspaces\ws
      [Pipeline] {
      [Pipeline] ws
      Running in D:\workspaces/ws
      

      The unexpected behavior occurs because FilePath does not normalize file separators and the FilePath is used to associate the lock in the inUse-Map of hudson.slaves.WorkspaceList.

      It works for relative paths because FilePath normalizes file separators in this case (due to -JENKINS-13649-), see FilePath#resolvePathIfRelative.

            Unassigned Unassigned
            c_kulenkampff Christian Kulenkampff
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: