rails / spring

Rails application preloader
MIT License
2.8k stars 339 forks source link

spring doubles the env size, sometimes causing "Argument list too long" error #626

Open michaelglass opened 3 years ago

michaelglass commented 3 years ago

Spring is great! You are great!

When spring spawns new processes, it passes in a copy of the original spring env, SPRING_ORIGINAL_ENV as an environmental variable.

https://github.com/rails/spring/blob/a85d32ef3726931b2b81abbb10a6e1c2964e7e32/lib/spring/application_manager.rb#L102

If the environment size is greater than half of ARG_MAX, the spring server, as well as other processes will spawn without spring but fail with spring because of an Argument list too long error.

Potential solutions:

jeremy commented 3 years ago

have specific environmental variables to watch rather than everything

The idea is to be agnostic to the existing environment, so everything Just Works from Spring users' point of view.

Some additional possibilities to pursue: