From ea5cf53096657a90f9e375bd8b7d3d821849f8d1 Mon Sep 17 00:00:00 2001 From: Guihao Liang Date: Fri, 8 May 2020 16:09:54 -0700 Subject: [PATCH] upload is not single threaded. Okay, we need to guard it --- src/core/storage/fileio/read_caching_device.hpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/core/storage/fileio/read_caching_device.hpp b/src/core/storage/fileio/read_caching_device.hpp index 52ea23d605..4e32b22351 100644 --- a/src/core/storage/fileio/read_caching_device.hpp +++ b/src/core/storage/fileio/read_caching_device.hpp @@ -232,14 +232,13 @@ class read_caching_device { // evict the file size cache { std::lock_guard file_size_guard(m_filesize_cache_mutex); - m_filename_to_filesize_map.erase(m_filename); - auto iter = m_filename_to_stop_watch.find(m_filename); if (iter != m_filename_to_stop_watch.end()) { // use no throw since this nanny thread may not start clock if (iter->second->stop(/* no throw */ true) == 0) { // nobody is holding m_filename_to_stop_watch.erase(iter); + m_filename_to_filesize_map.erase(m_filename); } } }