From 1dbcacb7b95b39f5d39e33601f85a71a670affda Mon Sep 17 00:00:00 2001 From: jackhumphries <1645405+jackhumphries@users.noreply.github.com> Date: Tue, 2 Apr 2024 11:32:26 -0700 Subject: [PATCH] Fixes the flaky mutable_object_test (#44413) Based on a local issue I resolved, I believe this commit should fix the flaky mutable_object_test in #44396. The header of the mutable object was not being explicitly initialized. In some cases, this caused deadlock due to a spinlock backed by garbage memory. This commit explicitly initializes the header, which should resolve the issue. Tested: mutable_object_test Signed-off-by: Jack Humphries <1645405+jackhumphries@users.noreply.github.com> --- src/ray/object_manager/plasma/test/mutable_object_test.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ray/object_manager/plasma/test/mutable_object_test.cc b/src/ray/object_manager/plasma/test/mutable_object_test.cc index d27aca12dbba..a05dd2b29dc5 100644 --- a/src/ray/object_manager/plasma/test/mutable_object_test.cc +++ b/src/ray/object_manager/plasma/test/mutable_object_test.cc @@ -113,7 +113,9 @@ std::unique_ptr MakeObject() { info.allocated_size = kPayloadSize; uint8_t *ptr = static_cast(malloc(kSize)); - return std::make_unique(ptr, info); + auto ret = std::make_unique(ptr, info); + ret->header->Init(); + return ret; } } // namespace