forked from openzfs/zfs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DOSE-1070 [Backport of DOSE-1020 to 6.0.13.0] I/O hang waiting on REA…
…D to complete (openzfs#246) If there are 2 concurrent calls to ObjectAccess::get_object_cached() for the same object, the 2nd caller will wait for the first to complete. If the GET fails (e.g. due to object not existing), we will drop the watch_once::Sender before calling send(), so the 2nd caller's recv() will fail, causing it to retry. However, when the 1st caller's GET failed, it neglected to remove its entry from the ObjectCache::reading. When the 2nd caller retries, it will again find reader (indicating that a GET is supposed to be in progress) and wait for it, but since the Sender was dropped, its recv() will fail, triggering another retry. The fix is to always remove the entry from ObjectCache::reading when the GET completes, whether or not it succeeded. Bonus cleanup: restructure this code so that there's only one code path that needs to remove the entry from ObjectCache::reading.
- Loading branch information
Showing
1 changed file
with
25 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters