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

Pipeline Job-- deletedir() delete only current directory but @script and @tmp dir still there in workspace.

    Details

    • Similar Issues:

      Description

      Directories with an ampersand (like @tmp and @script) are not removed when using 'deletedir()' in pipeline stage.

        Attachments

          Issue Links

            Activity

            Hide
            idanadar Idan Adar added a comment -

            +1

            Our agents remain unclean because of this.

            Show
            idanadar Idan Adar added a comment - +1 Our agents remain unclean because of this.
            Hide
            andreimuresianu Andrei Muresianu added a comment -

            +1 still a problem. The tmp directories do not add much value.

            Show
            andreimuresianu Andrei Muresianu added a comment - +1 still a problem. The tmp directories do not add much value.
            Hide
            karlparry Karl Parry added a comment - - edited

            +1 we now have about 200-300 @tmp/@script folders being created every day across several slave servers.

            -EDIITED-

            Will add theĀ script snippet provided above for current jobs for now

            Show
            karlparry Karl Parry added a comment - - edited +1 we now have about 200-300 @tmp/@script folders being created every day across several slave servers. - EDIITED - Will add theĀ  script snippet provided above for current jobs for now
            Hide
            jlpinardon jlpinardon added a comment -

            +1 I have added in a post always block a set of folderDelete operation... As far as I have only one slave, it is sustainable, but it will become ugly when using a label referencing several slaves.

            Show
            jlpinardon jlpinardon added a comment - +1 I have added in a post always block a set of folderDelete operation... As far as I have only one slave, it is sustainable, but it will become ugly when using a label referencing several slaves.
            Hide
            alexander_samoylov Alexander Samoylov added a comment - - edited

            Baptiste Mathus wrote: "Not a bug by the way, more an improvement."
            I strongly disagree. Jenkins creates the @tmp automatically and stores there temporary files. Therefore it should be removed also automatically by Jenkins.
            Each tool that produces temporary data should be responsible for its removal. It is easy as ABC.
            Following your logic, memory leaks are also "not a bugs"...

            +1 for the fix (which must be trivial)

            Update: I confirm that the workaround dir(<dir> + '@tmp')

            { deleteDir() }

            is working. Luckily it does not create the nested @tmp@tmp. Thank you, Niels van Aken.

            Show
            alexander_samoylov Alexander Samoylov added a comment - - edited Baptiste Mathus wrote: "Not a bug by the way, more an improvement." I strongly disagree. Jenkins creates the @tmp automatically and stores there temporary files. Therefore it should be removed also automatically by Jenkins. Each tool that produces temporary data should be responsible for its removal. It is easy as ABC. Following your logic, memory leaks are also "not a bugs"... +1 for the fix (which must be trivial) Update: I confirm that the workaround dir(<dir> + '@tmp') { deleteDir() } is working. Luckily it does not create the nested @tmp@tmp. Thank you, Niels van Aken .

              People

              • Assignee:
                Unassigned
                Reporter:
                hiten_prajapati Hiten Prajapati
              • Votes:
                60 Vote for this issue
                Watchers:
                76 Start watching this issue

                Dates

                • Created:
                  Updated: