rails / webpacker

Use Webpack to manage app-like JavaScript modules in Rails
MIT License
5.31k stars 1.47k forks source link

Intermittent Webpacker.dev_server.running? behavior #3269

Closed stevecrozz closed 2 years ago

stevecrozz commented 2 years ago

Ruby version: 2.7.3p183 Rails version: 6.0.4.6 Webpacker version: 4.1.0

Expected behavior: Webpacker.dev_server.running? should return consistent answers

Actual behavior: Webpacker.dev_server.running? returns true and false intermittently

As of https://github.com/rails/webpacker/pull/753

Webpacker uses by default a socket connect timeout of 1/100th of a second. I have seen situations developing locally where this is too fast and I get intermittent return values. Thankfully, the value is configurable, but going back to the PR where the change was made, I don't see any conversation specifically around the change from 1 full second to 1/100th of a second. It isn't clear that there was a reason for the change to the default value and basically I think the default value should be longer. Happy to put in a PR, but I'm putting in this issue first to see if there are any objections.

stevecrozz commented 2 years ago

Actually, I do see a blip of a conversation inline in that PR now, but it seems to be in reference to "slower systems" and I have seen this on a few modern systems now, one of them being a brand new M1 macbook.

justin808 commented 2 years ago

@stevecrozz Do you want to open this up on https://github.com/shakacode/shakapacker?