Skip to content

Call and await closeWatcher hooks on exit signals#5619

Merged
lukastaegert merged 1 commit intomasterfrom
gh-5615_close_watcher_signal
Aug 26, 2024
Merged

Call and await closeWatcher hooks on exit signals#5619
lukastaegert merged 1 commit intomasterfrom
gh-5615_close_watcher_signal

Conversation

@lukastaegert
Copy link
Copy Markdown
Member

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

List any relevant issue numbers:

Description

Previously, signal-exit would not await our async handling of the closeWatcher hook. This meant that when killing the watcher e.g. via SIGINT, those hooks would not be called. This is fixed here by synchronously returning true from the close handler.

@vercel
Copy link
Copy Markdown

vercel bot commented Aug 20, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
rollup ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 20, 2024 6:52pm

@github-actions
Copy link
Copy Markdown

github-actions bot commented Aug 20, 2024

Thank you for your contribution! ❤️

You can try out this pull request locally by installing Rollup via

npm install rollup/rollup#gh-5615_close_watcher_signal

Notice: Ensure you have installed the latest stable Rust toolchain. If you haven't installed it yet, please see https://www.rust-lang.org/tools/install to learn how to download Rustup and install Rust.

or load it into the REPL:
https://rollup-feuf3nwwc-rollup-js.vercel.app/repl/?pr=5619

@github-actions
Copy link
Copy Markdown

github-actions bot commented Aug 20, 2024

Performance report!

Rough benchmark

Command Mean [s] Min [s] Max [s] Relative
node _benchmark/previous/bin/rollup -i ./perf/entry.js -o _benchmark/result/previous.js 9.330 ± 0.066 9.255 9.381 1.00 ± 0.01
node _benchmark/current/bin/rollup -i ./perf/entry.js -o _benchmark/result/current.js 9.293 ± 0.038 9.258 9.334 1.00

Internal benchmark

  • BUILD: 8269ms, 750 MB
    • initialize: 0ms, 26.1 MB
    • generate module graph: 3174ms, 574 MB
      • generate ast: 1513ms, 567 MB
    • sort and bind modules: 447ms, 616 MB
    • mark included statements: 4637ms, 750 MB
      • treeshaking pass 1: 1569ms, 717 MB
      • treeshaking pass 2: 752ms, 743 MB
      • treeshaking pass 3: 299ms, 746 MB
      • treeshaking pass 4: 276ms, 743 MB
      • treeshaking pass 5: 321ms, 749 MB
      • treeshaking pass 6: 264ms, 753 MB
      • treeshaking pass 7: 248ms, 748 MB
      • treeshaking pass 8: 239ms, 751 MB
      • treeshaking pass 9: 219ms, 755 MB
      • treeshaking pass 10: 222ms, 755 MB
      • treeshaking pass 11: 219ms, 750 MB
  • GENERATE: 895ms, 1.02 GB
    • initialize render: 0ms, 914 MB
    • generate chunks: 87ms, 922 MB
      • optimize chunks: 0ms, 916 MB
    • render chunks: 788ms, 1 GB
    • transform chunks: 18ms, 1.02 GB
    • generate bundle: 0ms, 1.02 GB

@codecov
Copy link
Copy Markdown

codecov bot commented Aug 20, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 99.05%. Comparing base (262a388) to head (e68a5d0).
Report is 2 commits behind head on master.

Files Patch % Lines
cli/run/watch-cli.ts 75.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5619   +/-   ##
=======================================
  Coverage   99.05%   99.05%           
=======================================
  Files         242      242           
  Lines        9324     9325    +1     
  Branches     2467     2466    -1     
=======================================
+ Hits         9236     9237    +1     
+ Misses         58       57    -1     
- Partials       30       31    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@lukastaegert lukastaegert force-pushed the gh-5615_close_watcher_signal branch from 04f90bb to e68a5d0 Compare August 20, 2024 18:51
@lukastaegert lukastaegert merged commit c1d25d6 into master Aug 26, 2024
@lukastaegert lukastaegert deleted the gh-5615_close_watcher_signal branch August 26, 2024 14:21
@github-actions
Copy link
Copy Markdown

This PR has been released as part of rollup@4.21.1. You can test it via npm install rollup.

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.

closeWatcher is not called on SIGINT (Ctrl + C)

1 participant