Commit 2ffd0db
journal: separate out read-only peekLatest
Summary:
I have realized that Sapling's (and other things') use of getJournalPosition() has an unwanted side effect of setting lastModificationHasBeenObserved=true, which has interplay with EdenFS subscribers. Sapling isn't really observing anything, so we don't want to cause any disturbances.
Fix by separating getLatest to observeLatest (which sets lastModificationHasBeenObserved=true) and peekLatest. Since peekLatest doesn't write, we can also separate into a read/write lock to avoid the exclusive mutex acquisition in getJournalPosition.
The only caller I change in this commit to peekLatest is eden's use building its "status" cache key. I wanted to also change getCurrentJournalPosition (which is what "sl debugwait" calls), but it is necessary/intentional for getCurrentJournalPosition to set lastModificationHasBeenObserved=true based on callers' expected semantics.
Reviewed By: MichaelCuevas
Differential Revision: D95146037
fbshipit-source-id: ff658b57f1ebcb5e61d8fea4915cbd243bd8dbbb1 parent 4fb8bd0 commit 2ffd0db
1 file changed
+0
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
159 | | - | |
160 | 159 | | |
161 | 160 | | |
162 | 161 | | |
| |||
0 commit comments