Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

taskwarrior block(s) trigger duplicate recurrence instances #2071

Open
jkaiser-ioki opened this issue Jul 17, 2024 · 3 comments
Open

taskwarrior block(s) trigger duplicate recurrence instances #2071

jkaiser-ioki opened this issue Jul 17, 2024 · 3 comments

Comments

@jkaiser-ioki
Copy link

For some time I am observing duplicate instances for my taskwarrior recurrences. After some investigation with the taskwarrior devs we suspect that this may be due to a race condition among multiple simultaneous task invocations from automated processes, that each independently trigger the logic of checking for and creating missing recurrence instances.

The only instance of background processes that talk to task on my system are two blocks in my i3status-rs bar, that fire at 60s intervals. I had a look in the code of that block and noted the existence of the rc.gc=off flag that is used by the block's code. From my understanding that is there to prevent the updating of task IDs as part of the counting operation to prevent any unwanted cross-talk with manually interacting with the task-db.

The taskwarrior devs now suggest to add another runtime config override here to prevent updating recurrence instances as part of the counting operation, namely rc.recurrence.limit=0.

Are there any objections to this idea? Maybe make this configurable?

In the meantime I have disabled one of the two blocks to validate that this stops the duplicates from appearing. If that works, there is a high chance, that this project is the source of the duplicates.

For reference, here is the ticket tracking this topic on the taskwarrior side: GothenburgBitFactory/taskwarrior#3550

@jkaiser-ioki jkaiser-ioki changed the title taskwarrior block may trigger duplicate recurrence instances taskwarrior block(s) may trigger duplicate recurrence instances Jul 17, 2024
@jkaiser-ioki
Copy link
Author

Update: after about one week with the second block disabled, I have not seen any further duplicate taskwarrior recurrence instances, strengthening the above suspicion that the status block is at fault here.

@jkaiser-ioki jkaiser-ioki changed the title taskwarrior block(s) may trigger duplicate recurrence instances taskwarrior block(s) trigger duplicate recurrence instances Sep 24, 2024
@jkaiser-ioki
Copy link
Author

follow up: after 2 more month with only one of my two blocks the problem has not resurfaced.

Since I'd really like to have two instances of the taskwarrior block in my setup I'd appreciate at least some feedback here. I am not a rust expert but I could try to provide a PR with a fix (based on what the taskwarrior) devs have suggested.

@cfsmp3
Copy link
Contributor

cfsmp3 commented Sep 24, 2024

You don't really need to send a PR to test... Since the change is trivial you can give it a try by building with your change and see if it fixes it.

If not, I'll help you, I've been lazy lately since my setup does what I want already but I care about TW so if there's a bug I'd like to see it gone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants