Skip to content

fix: delete file lost wake #1323

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

xxchan
Copy link
Member

@xxchan xxchan commented May 13, 2025

Which issue does this PR close?

What changes are included in this PR?

Fix bug caused in #652

For detail see inline comments

Are these changes tested?

Comment on lines -208 to -215
match self.state.try_read() {
Ok(guard) => match guard.deref() {
DeleteFileIndexState::Populated(idx) => Poll::Ready(Ok(
idx.get_deletes_for_data_file(self.data_file, self.seq_num)
)),
_ => Poll::Pending,
},
Err(err) => Poll::Ready(Err(Error::new(ErrorKind::Unexpected, err.to_string()))),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have 2 possible problems here:

  1. try_read returns TryLockError::WouldBlock, which should not be an error, but Pending.
  2. More severely, we don't have any Waker set, so once Pending, the future will sleep forever.

Therefore, I think it's better to replace manual Future implementation with other sync primitives.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've addressed the missing Waker in my open PR in my open PR: 5f0b073

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which PR?

BTW, it seems in this commit the TryLock problem is not resolved

@xxchan xxchan force-pushed the xxchan/increased-wolf branch from abb3e65 to 596dc07 Compare May 13, 2025 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants