diff --git a/.changelog/12752.txt b/.changelog/12752.txt new file mode 100644 index 000000000..5e271c950 --- /dev/null +++ b/.changelog/12752.txt @@ -0,0 +1,3 @@ +```release-note:bug +csi: Fixed a bug where plugins would not restart if they failed any time after a client restart +``` diff --git a/client/allocrunner/taskrunner/plugin_supervisor_hook.go b/client/allocrunner/taskrunner/plugin_supervisor_hook.go index 415b6e20b..6e63dcfbe 100644 --- a/client/allocrunner/taskrunner/plugin_supervisor_hook.go +++ b/client/allocrunner/taskrunner/plugin_supervisor_hook.go @@ -129,10 +129,10 @@ func (*csiPluginSupervisorHook) Name() string { } // Prestart is called before the task is started including after every -// restart (but not after restore). This requires that the mount paths -// for a plugin be idempotent, despite us not knowing the name of the -// plugin ahead of time. Because of this, we use the allocid_taskname -// as the unique identifier for a plugin on the filesystem. +// restart. This requires that the mount paths for a plugin be +// idempotent, despite us not knowing the name of the plugin ahead of +// time. Because of this, we use the allocid_taskname as the unique +// identifier for a plugin on the filesystem. func (h *csiPluginSupervisorHook) Prestart(ctx context.Context, req *interfaces.TaskPrestartRequest, resp *interfaces.TaskPrestartResponse) error { @@ -191,9 +191,11 @@ func (h *csiPluginSupervisorHook) Prestart(ctx context.Context, mounts = ensureMountpointInserted(mounts, volumeStagingMounts) mounts = ensureMountpointInserted(mounts, devMount) + // we normally would set resp.Mounts here but without setting the + // hookResources before returning we can get a postrun hook that's + // missing resources. h.runner.hookResources.setMounts(mounts) - resp.Done = true return nil }