dhruvarya-db commented on code in PR #2696:
URL: https://github.com/apache/iceberg-rust/pull/2696#discussion_r3483534225


##########
crates/iceberg/src/delete_file_index.rs:
##########
@@ -86,17 +86,21 @@ impl DeleteFileIndex {
         data_file: &DataFile,
         seq_num: Option<i64>,
     ) -> Vec<FileScanTaskDeleteFile> {
-        let notifier = {
+        // Create the `Notified` while holding the read lock. 
`notify_waiters()` stores no

Review Comment:
   > The populator drops the write lock before it calls notify_waiters() (over 
in the populate task), so holding this read lock doesn't actually block the 
signal — a notify_waiters() can still fire the instant we drop the guard, 
before we first poll the future. 
   
   ```
   {
                       let mut guard = state.write().unwrap();
                       *guard = 
DeleteFileIndexState::Populated(populated_delete_file_index);
   }
   ```
   
   If the write lock has been taken and dropped already before we acquire this 
read lock, the state would have already been set to 
`DeleteFileIndexState::Populated`. We only need the notifier for the case where 
the state is `DeleteFileIndexState::Populating`
   
   
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to