Move to filelock library#1217
Conversation
lockfile has been deprecated for a long-time while filelock is well-maintained timeout message has changed because the existence of the lock file does not mean the file is actually locked anymore. Locks are handled by the OS Refs: GothenburgBitFactory#1183
ryneeverett
left a comment
There was a problem hiding this comment.
I'm going to merge this because it is an improvement but I'm questioning whether we need lock files at all in the medium term:
- I'm pretty sure I read that bitbucket issues are shutting down this year and since I believe bitbucket is the only consumer of BugwarriorData it will probably make sense to deprecate and remove it.
- I suspect the original reason we had a lockfile for the
bugwarrior pullcommand is that we were using theTaskwarriorDirectbackend from taskw which would open and manipulate the taskwarrior-2 json files. We've long since switched to theTaskwarriorShelloutimplementation which uses the taskwarrior command line interface, so I'm not sure there is any technical problem with concurrent bugwarrior processes. What do you think?
So I found 2 references to
I guess it still makes sense to ensure we only have 1 instance of bugwarrior trying to create new tasks, but I don't have any strong opinion about this. We can remove it if you think it's useless |
I'm fairly sure our service will break in August (unless somebody contributes support for Bitbucket Data Center) and we can remove it when that happens. I don't think we should take any action in the meantime.
Yeah, in hindsight it might make more sense to default to XDG_CACHE_HOME, but maybe we should still fall back to taskwarrior's
I suppose it makes sense to continue locking to avoid duplicate modifications so long as we're using the taskw backend. It may make more sense to do this at the transaction-level once we switch to taskchampion...we'll see. |
I haven't used it, but there is https://github.com/tox-dev/platformdirs , from the tox-dev team |
|
platformdirs does support XDG variables properly, I think it would be a good candidate to simplify all the data path logic. Should we create an issue to discuss this ? |
|
Sure. I've found the freedesktop specs very easy to follow but the cross-platform support is more compelling since I know nothing about that. |
lockfile has been deprecated for a long-time
while filelock is well-maintained
timeout message has changed because the existence of the lock file does not mean the file is actually locked anymore.
Locks are handled by the OS
Refs: #1183