-
Notifications
You must be signed in to change notification settings - Fork 6k
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
resource leak in ray/pthon/ray/node.py #9546
Comments
Great find |
Same problem met. Just call |
Same comment with pretty similar code:
|
cc @edoakes Wasn't this intentional? What's the best way to remove warning here? |
Couldn't reproduce the issue in the master (see output below). Closing it! Please reopen if you still see the issue.
|
use
|
Unfortunately this is still an issue. Running a test job with unittest ( # contents of test_ray.py
import ray
import unittest
class RayTest(unittest.TestCase):
def setUp(self):
self.ray_ctx = ray.init(num_cpus=1, num_gpus=0)
def tearDown(self):
ray.shutdown()
def test_method(self):
pass I have tested this with Python 3.10 on macOS Big Sur/Ray==2.8 and macOS Sonoma/Ray==2.9. |
Doesn't look like this got resolved. python 3.10 // ubunutu 22.04 // CUDA 12.2 |
I ran into this when integrating with the weaviate client: import weaviate
import ray
ray.init() python 3.11 // macos 14.4.1 |
I also ran into this when integration with the weaviate client. Python 3.11.8 // Debian GNU/Linux 12 (bookworm) // ray 2.10.0 |
update: I don't think this is actually related to the weaviate client. I wrote a script named import ray
ray.init() and ran it with: python -Wd bug.py and the warnings appear too. Could the problem be that the log file streams created in open_log are not closed elsewhere? |
What is the problem?
The script below returns
ResourceWarning: Enable tracemalloc to get the object allocation traceback
many times. It seems to be a resource leak in ray/pthon/ray/node.py, due to unclosed logging files. The same problem can also be seen by runningray/rllib/utils/exploration/tests/test_explorations.py
as-is.Reproduction (REQUIRED)
This will give the stack trace:
If we cannot run your script, we cannot fix your issue.
The text was updated successfully, but these errors were encountered: