-
Notifications
You must be signed in to change notification settings - Fork 165
Conversation
The introduction of repo locking caused tests with multiple nodes using the same temporary repo directory to fail.
e61c36a
to
e60e983
Compare
This was after concerns were raised about potential time-of-check to time-of-use (TOCTOU) issues. The check isn't actually necessary as `OpenOptions::create` set to `true` will create only if the file doesn't already exist.
fa7e982
to
02d98ad
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.
Minor nit on the perhaps extra #[async_trait]
. Bigger issue with the unwraps. Great that this started working.
As we've already discussed, the fs2
dependency while not actively maintained is probably ok for the short/medium-term. I can't see many reasons why this functionality would have to change though, given the fact that libc stuff doesn't change to often.
Repo locking was previously performed on repo::new, this keeps the Lock struct initialisation in repo::new but moves the locking into repo::init.
9e74bb1
to
500e401
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.
This one is looking good to go!
We did cover a lot of ground in chat outside of this higher latency review interface.
bors r+
Build succeeded: |
supersedes #426 and resolves #243.
This implements repo locking with fs2. The only concern for this crate is that it is poorly maintained but the functionality we need seems stable enough for now.
Certain tests are currently failing, notably because multiple nodes are being created with the same repo (dag tests for instance). Not sure what the solution to this will be...
Update: running tests with
--test-threads=1
passes all unit tests. The integration tests fail (I think because multiple nodes are being spun up with the same repo).Update 2: all green, making sure test nodes use a different temp dir for the repo fixed the tests.