Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FD Leak Tracker #6277

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

FD Leak Tracker #6277

wants to merge 1 commit into from

Conversation

tofarr
Copy link
Collaborator

@tofarr tofarr commented Jan 14, 2025

FD Leak Tracker

  • Include this change in the Release Notes. If checked, you must provide an end-user friendly description for your change below

I used this locally to clear up the leaks in the remote runtime, such that as of writing it no longer seems to leak at all. (In my PR) I figured it may be useful to others in testing the docker runtime, which currently seems to leak like a sieve.

If the environment variable "DEBUG" is set to "1", This code monkey patches the socket and open methods such that when one of these is initialized a stack trace is recorded. If 5 minutes pass and the resource is not closed, we print the stack trace.

I dunno if this is something we want to permanently include in openhands, but it does make finding leaks easier.


To run this PR locally, use the following command:

docker run -it --rm   -p 3000:3000   -v /var/run/docker.sock:/var/run/docker.sock   --add-host host.docker.internal:host-gateway   -e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:95dc35d-nikolaik   --name openhands-app-95dc35d   docker.all-hands.dev/all-hands-ai/openhands:95dc35d

@tofarr
Copy link
Collaborator Author

tofarr commented Jan 15, 2025

Thinking about this, I don't think it belongs in OpenHands - I'll create a separate open source utility for this over the weekend.

@enyst
Copy link
Collaborator

enyst commented Jan 15, 2025

Thinking about this, I don't think it belongs in OpenHands - I'll create a separate open source utility for this over the weekend.

That makes sense. I was thinking another alternative could be evaluation/utils. The evaluation directory is already not only benchmarks, it also has integration tests for example, and some utility scripts that don't run during benchmarking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants