Fix stress test with name deduping. (#40692)
Kevin Vega committed
Jun 8, 2026 at 10:43 UTC
6faf8243790c50fb1c14319e0711ae9b8ef40d03
1 file changed
+10
-3
src/windows/wslcsession/WSLCVolumes.cpp
+10
-3
@@ -123,9 +123,6 @@ WSLCVolumeInformation WSLCVolumes::CreateVolume(
123
auto [it, inserted] = m_volumes.insert({name, std::move(volume)});
124
WI_VERIFY(inserted);
125
126
- // Record that we initiated this create so OnVolumeEvent ignores the matching docker event.
127
- m_expectedEvents.emplace_back(name, VolumeEvent::Create);
128
-
126
return info;
127
}
128
@@ -270,6 +267,16 @@ __requires_lock_held(m_lock) void WSLCVolumes::OpenVolumeExclusiveLockHeld(const
267
{
268
OpenVolumeExclusiveLockHeld(m_dockerClient.InspectVolume(volumeName));
269
}
270
+ catch (const DockerHTTPException& e)
271
+ {
272
+ // A 404 here is expected when a late `create` event arrives after the volume has already
273
+ // been deleted (e.g. user calls CreateVolume then DeleteVolume; the create event from
274
+ // docker can race in after the delete has been processed).
275
+ if (e.StatusCode() != 404)
276
+ {
277
+ LOG_CAUGHT_EXCEPTION_MSG("Failed to open volume: %hs", volumeName.c_str());
278
+ }
279
+ }
280
CATCH_LOG_MSG("Failed to open volume: %hs", volumeName.c_str());
281
}
282