Spring fails to notice changes and reload frequently enough that it is a constant hindrance

We have same issue with some of our projects. spring ends up getting removed when introducing docker, so that the price to pay debugging is lot less for spring to notice the file changes, etc.

DISABLE_SPRING sometimes is not an option for a big team to make people opt-out.

A mid-way is to not adding binstubs and using the spring command where needed- spring rspec, spring rake. This allows whoever wants to opt-in make that choice, instead of making others pay the opt-out price.

3 Likes

This is what I was looking for. Thanks!

I literally just lost 30 minutes to Spring, which is why I was reminded to write this reply :slight_smile: I have it disabled globally, but work on one app that has somehow integrated it and so has to have it specifically enabled.

I did assume that, it is true, though it was mostly from the reaction I have had from other people when talking about it so it wasn’t entirely random :slight_smile: I was genuinely curious about other people’s thoughts on the matter though, so I created a poll, “Should Spring be removed as a default when creating a new Rails app?” to find out what the wider community thought: https://twitter.com/will_j/status/1263843035630186508. To save you the click:

Yes: 53.2% No: 17.6% Don’t care: 29.2%

With regards to only enabling spring at n seconds of boot time, there’s a problem with Spring, it doesn’t seem like the solution is to turn it on a bit later, it just means you’re going to get the problems later. I think there has to be some informed decision by the developer to enable it, perhaps with some sort of warning that it can cause strange loading issues.

1 Like

When I said it would had been nice to show a message of how long the rails boot has taken, I meant to actually show it every time, not just after a certain threshold.

Sure it’s a bit of noise, but if I consistently notice (I realize this will vary) rails booting slower than say two weeks before I’ll investigate and who knows maybe I’ll determine that I don’t need to require that entire heavy dependency I added some time ago. It might even save up some memory as well.

@viseztrance I was referencing this:

I did add measurements for app boot time at a previous contract, reporting to Datadog, so we could see the trend over time, it was pretty useful for spotting when problems happened.

This is one of those why didn’t I thing of that moments. Thanks for sharing!