[go: up one dir, main page]

Fix cleanup while cancelling during a snapshot import/export

This MR aims to fix a wrong behaviour that was observed a few times, when cancelling a snapshot export.

We now rely on the Lwt_exit clean-up callback mechanism to ensure clean-ups.

We now remove potential temporary directories left from an interrupted snapshot export.

Additionally, it removes the lock file when cancelling a snapshot import.

Fixes: #4098 (closed)

Manually testing the MR

Try to export a snapshot and cancel it (Ctrl-c) during the export. It might reproduce the behaviour at some point without the fix

for i in `seq 1 20`; do ./tezos-node snapshot export --data-dir ./snap --block head --rolling & ; sleep 2 ; kill -15 $!; done

For the import, cancel the import and look for the lock file in the data dir.

Checklist

  • Document the interface of any function added or modified (see the coding guidelines)
  • Document any change to the user interface, including configuration parameters (see node configuration)
  • Provide automatic testing (see the testing guide).
  • For new features and bug fixes, add an item in the appropriate changelog (docs/protocols/alpha.rst for the protocol and the environment, CHANGES.rst at the root of the repository for everything else).
  • Select suitable reviewers using the Reviewers field below.
  • Select as Assignee the next person who should take action on that MR
Edited by Victor Allombert

Merge request reports

Loading