Skip to content

Commit

Permalink
Detect corwlock deadlocks
Browse files Browse the repository at this point in the history
  • Loading branch information
lukemartinlogan committed Dec 23, 2024
1 parent fde66da commit ec78c87
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 5 additions & 1 deletion tasks/hermes_core/src/hermes_core.cc
Original file line number Diff line number Diff line change
Expand Up @@ -718,9 +718,10 @@ class Server : public Module {
HashBlobName(task->tag_id_, blob_name),
blob_name, task->flags_);
}

// Get blob map struct
BLOB_MAP_T &blob_map = tls.blob_map_;
BlobInfo &blob_info = blob_map[task->blob_id_];
chi::ScopedCoRwReadLock blob_info_lock(blob_info.lock_);

// Stage Blob
if (task->flags_.Any(HERMES_SHOULD_STAGE) && blob_info.last_flush_ == 0) {
Expand All @@ -732,6 +733,9 @@ class Server : public Module {
task->tag_id_, blob_info.name_, 1);
}

// Get blob struct
chi::ScopedCoRwReadLock blob_info_lock(blob_info.lock_);

// Read blob from buffers
std::vector<FullPtr<chi::bdev::ReadTask>> read_tasks;
read_tasks.reserve(blob_info.buffers_.size());
Expand Down
7 changes: 5 additions & 2 deletions test/pipelines/posix/test_hermes_posix_basic_small.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ pkgs:
- pkg_type: chimaera_run
pkg_name: chimaera_run
sleep: 5
do_dbg: false
do_dbg: true
dbg_port: 4000
modules: ['hermes_core']
- pkg_type: hermes_run
pkg_name: hermes_run
- pkg_type: hermes_posix_tests
pkg_name: hermes_posix_tests
test_file: posix_basic
test_case: SingleRead
hermes: true
size: small
dbg_port: 4001
do_dbg: true
# size: small

0 comments on commit ec78c87

Please sign in to comment.