Open jdoylei opened 7 months ago
writeSelector()
could retry, but unlike moveIfDoesNotExist()
, I think it should overwrite the content if the file already exists.
@chanseokoh - thanks for taking a look! I see you what you mean now - that writeSelector requires different logic from moveIfDoesNotExist. I'm thinking retry would help writeSelector, because we are only seeing the AccessDeniedException on the selectors directory and not anywhere else (like layers), so if retry is used for the layers directory, it's probably helping there.
Yeah, I agree.
@chanseokoh, is there any chance this might be addressed in an upcoming release? We've started another round of development this month where the developers were hitting this issue frequently again.
Environment:
Description of the issue:
We have 20+ Jib Maven projects that normally build successfully on our Windows laptops, but intermittently (every 10 builds or less) fail with AccessDeniedException indicating a file move from the user's tmpdir to the Jib application cache. Please see the Maven log excerpt below with the stack trace (using mvn -X). The failure happens to us often when using Maven Jib from "skaffold dev", due to the large number of builds done as code is changed.
Expected behavior:
Builds succeed consistently.
Steps to reproduce:
Run
mvn -X -l jib.log -pl :<child module name> -am -DskipTests package jib:build -Djib.containerize=:<child module name>
up to 10 times in Maven root project dir.jib-maven-plugin
Configuration:Log output:
Additional Information:
This looks like a combination of issue #1635 and #3572. It is happening to us with AccessDeniedException (rather than e.g. FileAlreadyExistsException) and in jib-cache/selectors rather than in jib-cache/layers.
We tried the following with no success:
MAVEN_OPTS=-Djava.io.tmpdir=...
)I think that multiple places in the Jib code were updated to use moveIfDoesNotExist and its retry logic, e.g. the code for jib-cache/layers, but not writeSelector and jib-cache/selectors. Could writeSelector use the same moveIfDoesNotExist retry approach?