axiom
axiom copied to clipboard
Race-Condition in Aid::send() method
Sending multiple messages might not be scheduled, if two threads send a message to the sender simultanously. If a context switch happens between sending and checking the receivable-count, the counter might never be 1 and will therefore never be scheduled to the executor.
match sender.send_await_timeout(message, system.config().send_timeout) {
Ok(_) => {
if sender.receivable() == 1 {
system.schedule(self.clone());
};
Ok(())
}
Err(_) => Err(AidError::SendTimedOut(self.clone())),
}