Skip to content

Proper cleanup after UserSquash

Pavlo Strokov requested to merge ps-user-squash-proper-cleanup into master

We should not use context.Context bound to the request as it could be cancelled or expire before cleanup operation executed. This issue could lead to a lot of different issues like repository inconsistent configuration, consumption of additional space, etc. To address this issue we should use SuppressCancellation wrapper for the context. The wrapped context will suppress cancellation or expiration of the parent context and at the same time will provide all values set into it in the interceptors, etc. Because SafeCmd and related func allowed to call only with context that could be cancelled we should use context.WithCancel wrapping on the result of the SuppressCancellation call.

Part of: #3075 (closed)

Edited by Pavlo Strokov

Merge request reports

Loading