flux-core icon indicating copy to clipboard operation
flux-core copied to clipboard

job-manager: `jobspec_update_pack` with jobid

Open jameshcorbett opened this issue 1 year ago • 1 comments
trafficstars

Problem: a flux-coral2 jobtap plugin would like to modify a job's jobspec asynchronously while the job is in DEPEND, but the flux_jobtap_jobspec_update_pack function only operates on the current job. It would be nice if there were a version of flux_jobtap_jobspec_update_pack that accepted a jobid argument.

See also https://github.com/flux-framework/flux-coral2/issues/158.

jameshcorbett avatar May 10 '24 17:05 jameshcorbett

flux_jobtap_jobspec_update_pack() has to stage jobspec updates so that they can be applied after the current jobtap callback returns. This is required so that the jobspec doesn't change out from under plugins while they're still referencing it.

If updating a jobspec for a job asynchronously, we don't necessarily need to stage the updates like that, so the function would be much simpler. In fact, it would be a small wrapper around flux_jobtap_event_post_pack(3) essentially, so perhaps an interim solution would be to use that to post a jobspec-update event?

grondo avatar May 10 '24 21:05 grondo