Skip to content

Commit f172198

Browse files
committed
Fixes job working directory resolution
The previous implementation relied on a configuration fallback that incorrectly mapped the global object-store base directory to individual jobs. Reading directly from the destination parameters prevents this unintended override and ensures resubmitted jobs correctly resolve their custom working directories.
1 parent 83dabfe commit f172198

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

lib/galaxy/jobs/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1875,7 +1875,7 @@ def _set_working_directory(self, job: Job):
18751875
``clear_working_directory``) must flush/commit themselves. The enqueue
18761876
path is covered by the ``commit()`` in ``enqueue()``.
18771877
"""
1878-
working_directory = self.get_destination_configuration("job_working_directory", None)
1878+
working_directory = self.job_destination.params.get("job_working_directory", None)
18791879
if isinstance(working_directory, str):
18801880
validate_working_directory_path(working_directory)
18811881
job.working_directory = working_directory

lib/galaxy/jobs/runners/state_handlers/resubmit.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,9 @@ def _handle_resubmit_definitions(
113113
# Persist the new destination before clearing the working directory.
114114
# set_job_destination() assigns job.destination_params = new_destination.params
115115
# and flushes, so when clear_working_directory() → _setup_working_directory()
116-
# → _set_working_directory() calls get_destination_configuration(), the model's
117-
# get_destination_configuration (model/__init__.py) reads job.destination_params
118-
# first — which now holds the *new* params, not the stale values from the prior
119-
# attempt. This is what makes a resubmitted job resolve its new JWD correctly.
116+
# → _set_working_directory() reads self.job_destination.params, which now
117+
# holds the *new* params, not the stale values from the prior attempt.
118+
# This is what makes a resubmitted job resolve its new JWD correctly.
120119
job_state.job_wrapper.set_job_destination(new_destination)
121120
# Reset job state. clear_working_directory() flushes the session after
122121
# _setup_working_directory() → _set_working_directory() mutates the

0 commit comments

Comments
 (0)