Skip to content
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

fix: do not panic on interrupt channel for watch #408

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

Conversation

sabify
Copy link
Contributor

@sabify sabify commented Dec 19, 2024

Closes: #385

@Eraden
Copy link

Eraden commented Jan 31, 2025

I tested similar approach but I tolerated lag to max 20 000 000 and unfortunately this just caused endless loop of rebuilds.

@sabify
Copy link
Contributor Author

sabify commented Jan 31, 2025

I tested similar approach but I tolerated lag to max 20 000 000 and unfortunately this just caused endless loop of rebuilds.

@Eraden You can check the behavior of this PR on top of the master branch. The logic has been changed in a separate merged PR in a way that if a notify comes in, the current builds will be terminated immediately and it starts to rebuild again. Please also consider that the lagged events will be run only once by this PR. (Assume we have 100 lagged events, the loop will be run only once to notify the 100 lagged events.)

@Eraden
Copy link

Eraden commented Jan 31, 2025

Unfortunately your fix is not working correctly. I justed tested it on my small project and I had endless loop

: Async, methods: [Get], regenerate: [], exclude: false }]
       Build interrupted. Restarting.
    Blocking waiting for file lock on package cache
    Blocking waiting for file lock on package cache
    Blocking waiting for file lock on package cache
    Blocking waiting for file lock on package cache
    Blocking waiting for file lock on package cache
    Blocking waiting for file lock on package cache
    Blocking waiting for file lock on package cache
   Compiling oswilno-models v0.1.0 (/code/oswilno/crates/oswilno-models)
       Build interrupted. Restarting.> ] 405/408: oswilno-models(build)
       Build interrupted. Restarting.
       Build interrupted. Restarting.
       Build interrupted. Restarting.
    Blocking waiting for file lock on package cache
    Blocking waiting for file lock on package cache
       Build interrupted. Restarting.
    Blocking waiting for file lock on package cache
       Build interrupted. Restarting.
       Build interrupted. Restarting.
       Build interrupted. Restarting.
       Build interrupted. Restarting.
    Blocking waiting for file lock on package cache
    Blocking waiting for file lock on package cache
    Blocking waiting for file lock on package cache
    Blocking waiting for file lock on package cache
    Blocking waiting for file lock on package cache
    Blocking waiting for file lock on package cache
    Blocking waiting for file lock on build directory
   Compiling oswilno-models v0.1.0 (/code/oswilno/crates/oswilno-models)
       Build interrupted. Restarting.> ] 405/408: oswilno-models(build)
       Build interrupted. Restarting.
       Build interrupted. Restarting.
       Build interrupted. Restarting.
    Blocking waiting for file lock on package cache
    Blocking waiting for file lock on package cache
    Blocking waiting for file lock on package cache
    Blocking waiting for file lock on package cache
    Blocking waiting for file lock on package cache
    Blocking waiting for file lock on package cache
    Blocking waiting for file lock on build directory
   Compiling oswilno-models v0.1.0 (/code/oswilno/crates/oswilno-models)
       Build interrupted. Restarting.> ] 405/408: oswilno-models(build)
    Blocking waiting for file lock on package cache
    Blocking waiting for file lock on package cache
    Blocking waiting for file lock on package cache
    Blocking waiting for file lock on package cache
    Blocking waiting for file lock on package cache
    Blocking waiting for file lock on package cache
    Blocking waiting for file lock on build directory
   Compiling oswilno-models v0.1.0 (/code/crates/oswilno-models)
       Build interrupted. Restarting.> ] 405/408: oswilno-models(build)
       Build interrupted. Restarting.
       Build interrupted. Restarting.
       Build interrupted. Restarting.
    Blocking waiting for file lock on package cache
       Build interrupted. Restarting.
    Blocking waiting for file lock on package cache
    Blocking waiting for file lock on package cache
    Blocking waiting for file lock on package cache
    Blocking waiting for file lock on package cache
    Blocking waiting for file lock on package cache
    Blocking waiting for file lock on package cache

@sabify
Copy link
Contributor Author

sabify commented Jan 31, 2025

Can you provide a small reproducible example and its steps? nothing happens for me even on big projects! You may get distracted by logs on each file changes, especially if you use -v or -vv.

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.

watch fails when a large(?) amount of files are changed at once
2 participants