Skip to content

Commit 644883b

Browse files
lterracclaude
andcommitted
fix(platform): address review comments on PR #53
- Add mutex locks to hasProducer/hasConsumer to prevent data race with the reconcile service thread modifying _actual* maps - Fix format string typo '%''' → '%s' in deployment verify() Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 8dfeae6 commit 644883b

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

platform/include/modules/channelController/module.hpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,16 @@ class Module final : public serving::modules::Module
7575
return _desiredConsumers[edgeName];
7676
}
7777

78-
[[nodiscard]] __INLINE__ bool hasProducer(const edgeName_t edgeName) const { return _actualProducers.contains(edgeName); }
79-
[[nodiscard]] __INLINE__ bool hasConsumer(const edgeName_t edgeName) const { return _actualConsumers.contains(edgeName); }
78+
[[nodiscard]] __INLINE__ bool hasProducer(const edgeName_t edgeName) const
79+
{
80+
std::lock_guard lock(_producerMutex);
81+
return _actualProducers.contains(edgeName);
82+
}
83+
[[nodiscard]] __INLINE__ bool hasConsumer(const edgeName_t edgeName) const
84+
{
85+
std::lock_guard lock(_consumerMutex);
86+
return _actualConsumers.contains(edgeName);
87+
}
8088

8189
[[nodiscard]] __INLINE__ std::weak_ptr<output_t> getProducer(const edgeName_t edgeName) const
8290
{

platform/include/modules/configuration/deployment.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ class Deployment final
242242

243243
// Make sure all tasks have at least one output
244244
if (task->getOutputs().size() == 0 && tasksWithDependencies.contains(task->getFunctionName()) == false)
245-
HICR_THROW_LOGIC("Deployment specifies task in partition '%'' with function name '%s' without any outputs or dependents\n",
245+
HICR_THROW_LOGIC("Deployment specifies task in partition '%s' with function name '%s' without any outputs or dependents\n",
246246
partition->getName().c_str(),
247247
task->getFunctionName().c_str());
248248

0 commit comments

Comments
 (0)