File conflicts in multiple cache paths defined in same cache step (OD-2258)
jbauer opened 12 months ago

In a gradle project I had created a a single job cache named gradle covering three gradle cache folders, namely /root/.gradle/caches, /root/.gradle/jdks and /root/.gradle/wrapper.

Today I was logged into a docker container currently executing a build and did take a look at the caches because I wanted to check if they contain outdated data (e.g. old JDKs). I noticed that this single cache was made available under /agent/work/temp/onedev-build-17-1328/cache/1 and the contents of caches, jdks and wrapper had been merged into that single cache/1 folder. In addition that merged content was available inside the container at /root/.gradle/caches, /root/.gradle/jdks and /root/.gradle/wrapper. So all three folders had the same content.

Is that really how you want it to work? What happens if I have multiple cache folders declared in a single cache and each folder has a file at the same location with the same name but different contents? Because these folder contents have been merged by OneDev the final content of this file will be random?

I expected that OneDev will produce a tar file that looks like

tar-file
  -> caches
       -> contents
  -> jdks
      -> contents
  -> wrapper
       -> contents

Then it would be unpacked to /agent/work/temp/onedev-build-17-1328/cache/1 and the three subfolders then linked to their original locations. Currently this subfolder layer for caches, jdks and wrapper is missing and the combined content of all folders in /agent/work/temp/onedev-build-17-1328/cache/1 is linked to each declared cache folder.

  • Robin Shen changed fields 12 months ago
    Name Previous Value Current Value
    Type
    Question
    Bug
    Affected Versions
    empty
    <=11.6.10
  • Robin Shen changed title 12 months ago
    Previous Value Current Value
    Cache management with multiple folders can overwrite files between folders?
    File conflicts in multiple cache paths defined in same cache step
  • OneDev changed state to 'Closed' 12 months ago
    Previous Value Current Value
    Open
    Closed
  • OneDev commented 12 months ago

    State changed as code fixing the issue is committed (b668b328)

  • OneDev changed state to 'Released' 12 months ago
    Previous Value Current Value
    Closed
    Released
  • OneDev commented 12 months ago

    State changed as build OD-5863 is successful

issue 1/1
Type
Bug
Priority
Normal
Assignee
Affected Versions
<=11.6.10
Labels
No labels
Issue Votes (0)
Watchers (2)
Reference
OD-2258
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover