linux/x11: Don't stop worker thread if handling selection request fails#186
Conversation
Just because one request fails, that doesn't mean we can't handle subsequent requests. Stopping the worker thread on failure means that every subsequent request will fail, which is usually undesirable.
|
Hey there, thanks for the PR. I like this idea overall. Out of curiosity do you have any additional context or examples of where this helps in the wild? I went through Given that, these seem like the only errors we are able to ignore during operations:
As much as I would like that the current architecture of the X11 clipboard doesn't support that. The background thread isn't owned by any specific |
I have an image organizer app, and it allows copying images to the clipboard. With this patch, it won't kill the worker thread, so the user can keep copying other images (and strings, etc.). |
Well, x11rb is its own thing, not bindings to XCB, so I wouldn't take the XCB documentation as "upstream". |
Thanks, that's helpful to know!
That's a very valid point. It was unclear how much of the error handling |
complexspaces
left a comment
There was a problem hiding this comment.
Thanks again!
Before I merge this, do you mind confirming that you did actually test that future copy operations work after the length exceeded error is logged? After that we're good. I couldn't exactly tell if you had live tested it or were just describing how it would behave.
Yes, I tested it, and can confirm future copies work |
|
If there is a way to check that the connection is closed, we could add a check for that in the event loop, and terminate if the connection is closed. |
|
Hey again, did you manage to find anything here? I skimmed through I'm thinking this might be low-risk to merge and see. I can always make a patch release if this causes unexpected problems. |
|
Sorry, I didn't manage to find anything, and kind of forgot about this. |
|
This behavior change is now present in 3.6.0 of |
…ls (1Password#186) * linux/x11: Don't stop worker thread if handling selection request fails Just because one request fails, that doesn't mean we can't handle subsequent requests. Stopping the worker thread on failure means that every subsequent request will fail, which is usually undesirable.
Just because one request fails, that doesn't mean we can't handle subsequent requests.
Stopping the worker thread on failure means that every subsequent request will fail, which is usually undesirable.
Unresolved questions
I don't know if this has any undesirable side effects, since I'm not an X11/clipboard expert.
This requires careful review.