Skip to content

Unnecessary file reloading issue 318#320

Merged
jappeace merged 3 commits intosnoyberg:masterfrom
ktak-007:unnecessary-file-reloading-issue-318
Sep 27, 2025
Merged

Unnecessary file reloading issue 318#320
jappeace merged 3 commits intosnoyberg:masterfrom
ktak-007:unnecessary-file-reloading-issue-318

Conversation

@ktak-007
Copy link
Copy Markdown
Contributor

No description provided.

@jappeace
Copy link
Copy Markdown
Collaborator

@jappeace jappeace merged commit 4065ce8 into snoyberg:master Sep 27, 2025
9 checks passed
Copy link
Copy Markdown
Contributor

@ulidtko ulidtko left a comment

Choose a reason for hiding this comment

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

We can't realistically expect real-world scenarios to follow the fixed-interval pace of "chunk - 300ms - chunk - 300ms - chunk - 300ms ..." when writing the incoming file.

I'd strongly prefer the slow.c test to do randomized delays instead. FWIW, the geometric distribution provides good practice when modelling uncertainty of the pace of arrival of external events.

As for the fix: it's not reliable. As you said @ktak-007, will still exhibit premature reloading of partially-written bundles. More rarely sure, but debouncing through hardcoded 1-second delay will not fully fix #318.

Mind that servers and network can, very realistically, become temporarily overloaded (making writing of one particular file appear slow); also VM hypervisors and container runners may throttle and load-share the CPU (making essentially everything appear slow / programs seeing time run too fast).

I acknowledge it's useful to have the debouncing logic (no matter how imperfect) for platforms without CLOSE_WRITE. There, we can't do any better. But, if we can get fully reliable fix on platforms with CLOSE_WRITE (Linux) -- we should do that.

@ulidtko
Copy link
Copy Markdown
Contributor

ulidtko commented Sep 27, 2025

@jappeace very good? 🤨

The test literally failed, with AssertionError.

Screenshot 2025-09-27 at 23 52 59

@jappeace
Copy link
Copy Markdown
Collaborator

On that branch, I reverted their changes to confirm their test works.

and let the perfect not be the enemy of the good.
no PR was made for the Linux patch so it wasn't merged, but we can add it in future as well.

@ulidtko
Copy link
Copy Markdown
Contributor

ulidtko commented Sep 27, 2025

OK, got it! Awesome then 🚀

Edit: I still hold that the test is not realistic. But oh well. Better than nothing.

@jappeace
Copy link
Copy Markdown
Collaborator

tests are often abstract understandings of real problems.
A simple test like this makes it easy to understand why it failed.
We can introduce random delays but now you risk non-determism in the test suite which is it's own problem 😅

so I'd say it's a good test as is, but certainly not perfect.

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.

3 participants