-
Notifications
You must be signed in to change notification settings - Fork 154
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
Mailbox locking refcount #4731
Mailbox locking refcount #4731
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just have a few nits that might be nice to address, but no hard requirement. I'll wait for CI to finish to approve.
ad71897
to
fb57b4e
Compare
Damn tests pass on my box :( |
These tests are failing on my local build
I only glimpsed at JMAPCalendars.calendarsharenotification_changes and it seems like where creating a share notification and deleting one each bumped the modseq on the notifications mailbox, the create now silently does not bump the modseq. Haven't dug deeper. |
@brong If the tests pass for you locally, they might be dependent on some local config you have but no-one else does. What's in the |
This feels like a pretty high-risk PR, both due to the extent of the changes and the mysteries exposed in testing so far. Even once this passes CI, it seems likely that other edge cases will arise that we don't yet have adequate test coverage for. So I think this should be "DO NOT MERGE" and "include in fastmail" for a while before it lands on master, to give us time to use it for real and shake them out before we start calling it release quality. Especially with it being only about 6-7 weeks until we fork the new 3.10 stable branch! So I'm tagging this DO NOT MERGE for now, and if it's ready for our builds this year we can tag it "include in fastmail". It can land on master next year, after the 3.10 branch has forked. |
168f990
to
81fe9ed
Compare
Thanks @elliefm, that seems reasonable! I'm hoping this time it will actually pass. It's shaken out some bugs in assumptions in other code :) But yeah, complex changes for sure. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One nit; also something odd going on in reconstruct, looks like the mailbox is neither committed nor closed after mailbox_setversion() succeeds?
81fe9ed
to
eec344d
Compare
@ellie fixed the setversion issue and also added a test which exercises it! |
@rsto did you want to update your review on this? |
We gotta be more careful about pinging "elliefm" and "ksmurchison", rather than "ellie" and "Murch" who are nothing to do with this project ;) This is still failing in CI, on a few JMAPContacts tests. The failures are interesting... one was like this:
Another failure expected to receive one content-type but got a completely different one (sorry, I forgot which by the time I got to typing here) And the other got back a 500 error response, when it was expecting a document that matched a pattern like "this should not crash the server" It kinda smells like these tests are getting back completely different documents from what they expected. I wonder if there's something up with the changes to the jmap mailbox cache handling? I've told the CI job to re-run, on the off-chance that it was some transient weirdness, though that seems unlikely... and tbh if it were a transient issue I think I'd be even more concerned. I'll pull the branch and run it locally too, once my current cass run finishes, and see if that sheds any new light. |
Here's the local failures:
The restarted CI job also failed again, with the same four failures: https://github.com/cyrusimap/cyrus-imapd/actions/runs/6902252975/job/18830872467?pr=4731 |
cd87f67
to
f783196
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still one bad xsyslog call. But it passes CI now! :)
085684b
to
583ba6e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The loop/global changes from the latest two commits look good. But you haven't yet fixed the xsyslog typo (in http_dav_sharing) from my last review. It'll produce a gibberish log message if the error condition it's logging about ever occurs.
583ba6e
to
52efd18
Compare
There's a ton more changes in here now! I added namelock ordering checks and found many things. There's still issues with:
(update to this comment for clarity) - these are tests which fail namelock ordering tests on the user locks - so they COULD cause a deadlock. In practice this is going to be super rare, so I left the code for user namelock ordering checks in, but commented it out, so all tests pass because they aren't checking for this condition. The complex things to fix still are:
|
This makes jmap_openmbox useless, we'll remove that next
…re opened readonly
This just serialises and unserialises, which is pretty inefficient but easy to write
This means they sort alphabetically the same as elsewhere
This requires opening conversations late as well, but means our lock ordering is always valid
Co-authored-by: elliefm <[email protected]>
Co-authored-by: elliefm <[email protected]>
9a570fc
to
9255220
Compare
This brings back the mboxlist_changesub modseq bump but also rewrites mailbox refcounting so it works, and ALSO replaces the JMAP mailbox cache as part of that change.
There are probably more places we can just open and close rather than having to track the index mailbox too.