web-infra-dev / rspack

The fast Rust-based web bundler with webpack-compatible API 🦀️
https://rspack.dev
MIT License
10.13k stars 575 forks source link

[Bug]: Long shutdown time of serve mode #8511

Open ioma8 opened 3 days ago

ioma8 commented 3 days ago

System Info

System: OS: macOS 14.5 CPU: (10) arm64 Apple M1 Pro Memory: 2.13 GB / 32.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 20.13.1 - ~/.nvm/versions/node/v20.13.1/bin/node Yarn: 4.4.1 - ~/.nvm/versions/node/v20.13.1/bin/yarn npm: 10.8.3 - ~/.nvm/versions/node/v20.13.1/bin/npm Browsers: Brave Browser: 127.1.68.128 Chrome: 131.0.6778.86 Firefox: 132.0 Safari: 17.5 npmPackages: @rspack/cli: ^1.0.8 => 1.0.8 @rspack/core: ^1.0.8 => 1.0.8

Details

The shutdown time of rspack is badly too long. When I press CTRL+C on the running rspack, it shows the following message:

[webpack-dev-server] Gracefully shutting down. To force exit, press ^C again. Please wait...

And takes about 20 seconds until it shuts down. The hint to precc CTRL+C again does also nothing to speed this up. I often switch between projects and this makes it painful for me.

Reproduce link

No response

Reproduce Steps

  1. run rspack in serve mode rspack serve --config config/rspack.config.dev.ts
  2. press CTRL+C to quit
  3. takes about 20 seconds to quit
  4. second press CTRL+C does nothing to speed this up

the same happens when I try to kill it in other ways.

hardfist commented 1 day ago

it's related to watchpack limitation and we're gonna fix by reimplementing watch in rust side, related to https://github.com/web-infra-dev/rspack/issues/8455