Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Lib is flooding root file system #267

@kamurashev

Description

@kamurashev

The proj I'm working on is using the lib into automation test suits. Tests are being run by Jenkins and Jenkins being hosted on a bare metal. From time to time I'm facing with
IOException: No space left on device
It appears the lib is flooding /tmp directory with numerous of config file repo clones, e.g.:

jenkins@jenkinsmaster01:~$ ls -ld /tmp/cfg*
drwxr-xr-x 4 jenkins jenkins 4096 May 23 00:21 /tmp/cfg4j-git-config-repository1196432648052804977
drwxr-xr-x 3 jenkins jenkins 4096 May 19 17:36 /tmp/cfg4j-git-config-repository1210794336978573061
...
'a lot of same directories goes here'
...

Here's the place where the path being initialized:

tmpPath = Paths.get(System.getProperty("java.io.tmpdir"));

Each run new randomly named dir is created and NOT being cleared after:

clonedRepoPath = Files.createTempDirectory(tmpPath, tmpRepoPrefix);

I have a feeling this was intended to clear old copies, but in fact it doesn't as each time new random long is being appended to the path and old dirs is not deleted.

Given above:

  1. I believe it is must for documentation to mention that repo would be cloned to System temp directory and furthermore I believe the directory should be configurable, as a workaround I'm passing:
    -Djava.io.tmpdir={not-root/custom tmp dir} to java.
  2. Code should be updated so it would clear all the leftovers after its execution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions