mongo icon indicating copy to clipboard operation
mongo copied to clipboard

Implement waitable_atomic for FreeBSD

Open ronaldklop opened this issue 1 year ago • 4 comments

Based on the Apple implementation rewritten to use _umtx_op syscall.

ronaldklop avatar Jan 09 '25 10:01 ronaldklop

Thanks for making this pull request! We just need a couple of things from you to start our consideration of the PR. Can you please:

  1. Sign our Contributor's Agreement.

  2. Create a new SERVER ticket on JIRA.

kelly-cs avatar Jan 09 '25 18:01 kelly-cs

Thanks for making this pull request! We just need a couple of things from you to start our consideration of the PR. Can you please:

1. Sign our [Contributor's Agreement](https://www.mongodb.com/legal/contributor-agreement).

2. Create a new SERVER ticket on [JIRA](https://jira.mongodb.org/).

Thanks for your quick response. I signed the agreement and created a ticket: https://jira.mongodb.org/browse/SERVER-99225.

ronaldklop avatar Jan 10 '25 12:01 ronaldklop

Sorry for the delay in writing back. My team owns this code and we have been debating internally what to do with this PR. On the one hand, we appreciate the effort to upstream support for other platforms. But on the other, we are hesitant to accept maintenance of code that isn't executed in our CI system and that we have limited ability to test. Our preference would probably be for you to maintain this as an out of tree patch. How much of a hardship would that be for you?

As for the code, I wanted to provide some feedback to ensure that you have the best version, regardless of whether it gets merged or maintained out-of-tree. Based on my reading of https://man.freebsd.org/cgi/man.cgi?query=_umtx_op&sektion=2&n=1, I think it would be better to base this off of the linux version rather than the apple version of the code. It seems like _umtx supports both absolute deadlines rather than relative timeouts, and supports a both nanosecond resolution and (assuming time_t is 64 bits) a long range into the future. The apple version needs to jump through some hoops to handle their unfortunate choice of 32-bit microseconds of relative timeouts.

RedBeard0531 avatar Jan 21 '25 19:01 RedBeard0531

Thanks for the answer. I understand the suggestion for the implementation with absolute time. I will take a look at that in the near future.

Maintaining the patches out of tree is doable. As I'm doing it for quite some time now. I just thought it would be nice to upstream some of this code. As it is a working port of MongoDB on a popular posix OS. Of course your team is in the lead and I'm happy with what you decide is possible. Feel free to close the PR.

ronaldklop avatar Jan 28 '25 13:01 ronaldklop

I'm going to go ahead and close this. I'd rather we not merge non-trivial code that we don't have any ability to test in an ongoing manner in CI.

RedBeard0531 avatar Jun 23 '25 12:06 RedBeard0531