-
-
Notifications
You must be signed in to change notification settings - Fork 125
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
[BUG] Groups Config Gets Erased Randomly #116
Comments
Well, this doesn't look good at all. This is weird on multiple levels, especially because the
I don't see how this can happen, especially since Rust has a very strict type system and The only thing I can currently come up with is, that two different threads of pueue try to write the config file at the same time. I'll try to reproduce this bug in the next few days. |
you might be right about writing to configs at the same time not sure if this is related but if i execute the kill and remove command real fast, the daemon will crash Steps To Reproduce
$ pueue status
if i use sleep command then is working fine as normal
|
That's actually another problem, which comes from me seemingly not properly using mutexes... I'm not exactly sure how this can happen, but somehow this manages to poison the mutex on the shared state (shared memory between threads). Damn. I'm really having trouble to reproduce those issues. No matter what I'm trying, it just won't break :D I'll try to continue debugging in the near future. Unfortunately, I don't have a lot of time lately. |
no problems take your time. lols I will try to find more bugs for you to fix when you come back |
The second problem (The PoisonError) should now be a lot easier to debug. Though, I'm still not able to reproduce the I created a new issue #119 to track this bug. In case you want to help out and install pueued with the newest master branch: There are some breaking changes in the planned 0.8.0 version.
But besides that, you'll be finally able to use unix-sockets instead of tcp-sockets :) |
Ok. Here's what I got on the actual bug of this issue. The daemon requires the mutex to be aquired for being able to save the config file.
However, the client saves the settings file every time it starts up! One possible scenario I came up with is:
I'm not too familiar with how writing and exclusive acces are normally handled in Unix. The client might read the config file at the exact same time the daemon is writing it. However, stuff like this will be rendered impossible with commit 2432674. This prevents the client from ever touching the config. On top of this, commit 02e9231 removes the default behavior of always writing the configuration file at daemon startup. With the new behavior, this will only happen, if there's actually a change to the configuration, i.e. missing values which can be patched with default values. I think, that this should remove a LOT of error potential and unnecessary writes to the configuration files. If the bug is still there, I would suspect an upstream bug in the serde-yml crate. |
for sure ill give it a try in a few days |
Describe the bug
I can't really reproduce it as it happens randomly but it happens a few times already. The program would be working perfect for a few mins/hours/days then i would get the error message below. I have not touch any config files. Only been using it from the commandline. I do have a few pueue groups. which i think is the cause of the issue since if i compare the config files in the beginning and when i get the error is totally different. The groups gets delete from the configs somehow.
$ pueued -d && sleep 3 && pueue group --add fm && pueue group --add cl && pueue group --add dl && pueue group --add wb && pueue group --add vids && pueue group --add clips
NOT WORKING
$ cat ~/.config/pueue.yml
Temporary Fix
WORKING
$ cat ~/.config/pueue.yml
Additional context
The text was updated successfully, but these errors were encountered: