rojo-rbx / rojo

Rojo enables Roblox developers to use professional-grade software engineering tools
https://rojo.space
Mozilla Public License 2.0
968 stars 182 forks source link

Too many open files (os error 24) #214

Closed MagiMaster closed 4 years ago

MagiMaster commented 5 years ago

On Mac, if you leave "rojo serve" running overnight it will eventually crash with "[ERROR hyper::server::tcp] accept error: Too many open files (os error 24)". This doesn't actually kill the server, but does make it unresponsive. (Manually killing and restarting it fixes things for another day.)

LPGhatguy commented 5 years ago

Weird!

I wonder what layer this bug is happening at. Some things it could be off the top of my head:

MagiMaster commented 5 years ago

It looks like it might behave differently if Studio isn't left connected to it. I'm not 100% sure I left it open long enough that it should have crashed, but there was no error message this morning.

LPGhatguy commented 5 years ago

That makes sense!

Studio communicates with the Rojo server (implemented with Hyper/Tokio) through HTTP long-polling. It starts up a request and relies on HTTP timeout behavior to create server->client notifications. In Roblox, that means that the client has to restart the request every 30 seconds or so, assuming no changes are happening. Over night, that's a couple thousand HTTP requests that time out. There could be a memory leak in Rojo or one of Rojo's dependencies that could be leaking these requests.

LPGhatguy commented 4 years ago

I'm going to close this issue since we haven't seen anyone else with it pop back up. Feel free to re-open it or leave a comment if you hit this again!

I think it's likely to be a Tokio issue, which we should also be able to resolve by upgrading some of our dependencies there.