Commit d16e3fb
fix: Fix race condition in MockSharedArbitrationTest.localArbitrationRunInParallelWithGlobalArbitration (#16731)
Summary:
Pull Request resolved: #16731
The test spawned `globalArbitrationTriggerThread` before installing the
`SCOPED_TESTVALUE_SET` callback for `runGlobalArbitration`. If the thread's
allocations triggered global arbitration before the callback was registered,
`globalArbitrationStarted` would never be set to true, causing the main thread
to deadlock on `globalArbitrationStartWait.await()`.
Fix by moving the `SCOPED_TESTVALUE_SET` and its synchronization variables
before the thread spawn, ensuring the callback is always registered before any
allocation can invoke `runGlobalArbitration`.
Fixes #15336
Reviewed By: xiaoxmeng
Differential Revision: D96181396
fbshipit-source-id: d4674a551411ddcc1eaf4b82ca5a060d7aeb11be1 parent 3f02431 commit d16e3fb
File tree
1 file changed
+20
-17
lines changed- velox/common/memory/tests
1 file changed
+20
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1900 | 1900 | | |
1901 | 1901 | | |
1902 | 1902 | | |
| 1903 | + | |
| 1904 | + | |
| 1905 | + | |
| 1906 | + | |
| 1907 | + | |
| 1908 | + | |
| 1909 | + | |
| 1910 | + | |
| 1911 | + | |
| 1912 | + | |
| 1913 | + | |
| 1914 | + | |
| 1915 | + | |
| 1916 | + | |
| 1917 | + | |
| 1918 | + | |
| 1919 | + | |
| 1920 | + | |
| 1921 | + | |
| 1922 | + | |
1903 | 1923 | | |
1904 | 1924 | | |
1905 | 1925 | | |
| |||
1952 | 1972 | | |
1953 | 1973 | | |
1954 | 1974 | | |
1955 | | - | |
1956 | | - | |
1957 | | - | |
1958 | | - | |
1959 | | - | |
1960 | | - | |
1961 | | - | |
1962 | | - | |
1963 | | - | |
1964 | | - | |
1965 | | - | |
1966 | | - | |
1967 | | - | |
1968 | | - | |
1969 | | - | |
1970 | | - | |
1971 | | - | |
1972 | 1975 | | |
1973 | 1976 | | |
1974 | 1977 | | |
| |||
0 commit comments