Development server consistently dying - 'V8 Isolate was forked'

I’ve been having some fairly consistent trouble with the Discourse development server throwing the following error message, which appears to kill the server pid.

WARNING: V8 isolate was forked, it can not be disposed and memory will not be reclaimed till the Ruby process exits.

It’s not so big a deal to need to restart the server now and again, but it seems to happen fairly regularly on my machine during development. Any steps to avoid this, or a way to turn it off in development mode?

1 Like

Are you using puma in a non-cluster mode?

Oh, hm. Looks like it’s picking up ‘thin’ as the default rails server (I’m just running bundle exec rails s from the project root; can’t be bothered with a Vagrant or anything)

But if I do specify puma explicitly, looks like it spins up in single mode:

Do you still get the issue when using puma?

Haven’t noticed this over the past couple days using Puma. I see Discourse includes both thin and puma in the Gemfile; does it make sense to either run both with the same server, or specify Puma as the default app server using Rack::Handler.pick or something similar?

I actually think it may be time to drop thin from the dependencies. Going ahead and doing that now.

EDIT: this is now done, we no longer carry an unloaded dependency to event machine … so yay!

8 Likes

Note: one thing that dropping thin did bring up is that our silencer middlewares were not thread safe. That got super annoying in dev mode cause logs would keep getting disabled.

I fixed that per:

https://github.com/discourse/discourse/commit/a898d6a02a28406bfd0033a5e4d044a0ecbe71f9

4 Likes