Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions src/windows/wslcsession/WSLCVolumes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,6 @@ WSLCVolumeInformation WSLCVolumes::CreateVolume(
auto [it, inserted] = m_volumes.insert({name, std::move(volume)});
WI_VERIFY(inserted);

// Record that we initiated this create so OnVolumeEvent ignores the matching docker event.
m_expectedEvents.emplace_back(name, VolumeEvent::Create);

return info;
}

Expand Down Expand Up @@ -261,6 +258,16 @@ __requires_lock_held(m_lock) void WSLCVolumes::OpenVolumeExclusiveLockHeld(const
{
OpenVolumeExclusiveLockHeld(m_dockerClient.InspectVolume(volumeName));
}
catch (const DockerHTTPException& e)
{
// A 404 here is expected when a late `create` event arrives after the volume has already
// been deleted (e.g. user calls CreateVolume then DeleteVolume; the create event from
// docker can race in after the delete has been processed).
if (e.StatusCode() != 404)
{
LOG_CAUGHT_EXCEPTION_MSG("Failed to open volume: %hs", volumeName.c_str());
}
}
CATCH_LOG_MSG("Failed to open volume: %hs", volumeName.c_str());
}

Expand Down