darcs

Patch 2225 catch all takeLock exceptions in withLockCanFail

Title catch all takeLock exceptions in withLockCanFail
Superseder Nosy List bfrk
Related Issues
Status accepted Assigned To
Milestone

Created on 2021-11-10.07:29:00 by bfrk, last changed 2023-06-24.00:38:07 by ganesh.

Files
File name Status Uploaded Type Edit Remove
catch-all-takelock-exceptions-in-withlockcanfail.dpatch bfrk, 2021-11-10.07:28:56 application/x-darcs-patch
patch-preview.txt bfrk, 2021-11-10.07:28:56 text/x-darcs-patch
See mailing list archives for discussion on individual patches.
Messages
msg22928 (view) Author: bfrk Date: 2021-11-10.07:28:56
1 patch for repository http://darcs.net/screened:

patch d6f6944fabc17a460527e5a6309b608fcc1ca65b
Author: Ben Franksen <ben.franksen@online.de>
Date:   Mon Nov  8 17:08:39 CET 2021
  * catch all takeLock exceptions in withLockCanFail

  Note that withLockCanFail is used in commands that are otherwise read-only,
  such as annotate and log (with a filename), in order to create a patch
  index. These commands should not fail if taking the lock fails for whatever
  reason (e.g. no write permission). This is important for instance when using
  darcsweb.
Attachments
msg23240 (view) Author: ganesh Date: 2023-04-01.07:58:52
Looks fine.

I wonder if we should pass the exception message upwards so that the
caller can choose to print out a warning? I guess it's debatable
whether read-only commands should print out warnings about the index.
msg23245 (view) Author: bfrk Date: 2023-04-01.15:04:10
A warning would indicate to the user that we cannot create a patch index 
and why. Now, creating a patch index is quite expensive (we must read all 
patches in the history), so it is mostly an investment to improve the 
performance of /future/ commands of a similar nature. Explaining all of 
this would be quite verbose and probably confusing to inexperienced users.
History
Date User Action Args
2021-11-10 07:29:00bfrkcreate
2021-11-10 07:30:32bfrksetstatus: needs-screening -> needs-review
2023-04-01 07:58:52ganeshsetstatus: needs-review -> accepted-pending-tests
messages: + msg23240
2023-04-01 15:04:11bfrksetmessages: + msg23245
2023-06-24 00:38:07ganeshsetstatus: accepted-pending-tests -> accepted