Shared GRADLE_USER_HOME via node-local hostPath: journal cache lock timeout across pods (Owner PID == Our PID); Jenkins same-host parallel OK #16871
Replies: 2 comments 2 replies
|
this is expected / a known footgun, not an Argo scheduler bug. why
so: sharing a writable Gradle user home across concurrent pods on node-local disk is unsafe for journal/cache locks, even when the volume is not NFS. docs calling that out would be accurate. |
|
One correction to the diagnosis above, because it changes whether Gradle doesn't use the PID to arbitrate these locks. The PID in the lock file is only written for the error message. When a process can't get a lock, it reads the port of the current owner from the lock file and sends it an "unlock request" over UDP to a local address. The owner then releases the lock (for caches like Every pod has its own network namespace, so its own loopback. Pod B sends the unlock request to So The approach Gradle supports for "warm caches, many concurrent containers" is the read-only dependency cache:
env:
- name: GRADLE_RO_DEP_CACHE
value: /opt/gradle-ro-cache
- name: GRADLE_USER_HOME
value: /home/gradle/.gradle # emptyDir, per pod
volumeMounts:
- name: gradle-ro-cache
mountPath: /opt/gradle-ro-cache
readOnly: trueDocs: https://docs.gradle.org/current/userguide/dependency_caching.html#sec:shared-readonly-cache. Two caveats from the docs: the RO cache must not be written to while builds read from it (refresh it by swapping directories, not in place), and you shouldn't point it at a live Gradle user home. The feature is still marked incubating, but Gradle 7.4 already supports it. For task outputs, add a remote build cache. Together these give you warm dependencies and parallel builds without sharing a writable home. |
Uh oh!
There was an error while loading. Please reload this page.
Summary
We share a writable Gradle user home across concurrent Argo Workflow pods using node-local disk (
hostPath, not NFS). Concurrent./gradlewruns often fail at Gradle startup with a journal cache lock timeout. The lock file frequently reports Owner PID == Our PID.The same Gradle usage on a Jenkins agent (multiple processes, one PID namespace, local
~/.gradle) does not hit this failure: parallel builds proceed (or wait briefly on locks).We are filing this to clarify whether this is a known limitation of sharing build-tool home directories across pods, and whether docs should call it out. We are not asking for a specific mitigation design in this issue—primarily want the behavior documented / confirmed.
Environment
06c761b8cc993aa6ab60f8c35c3c95bb334f3da0)hostPathor equivalent), e.g./opt/workflow-data/gradlew./gradlew --no-daemon clean <module>:build -x testError
All reactions