remcollier / astra

This repository is no longer maintained. For more information on ASTRA, please visit http://astralanguage.com
http://astralanguage.com
5 stars 0 forks source link

Bug in Cartago API #13

Closed remcollier closed 7 years ago

remcollier commented 7 years ago

When running cartago programs, the agents randomly freeze.

remcollier commented 7 years ago

this is caused by a synchronization issue. The Cartago module auto-action method invokes the operation on the cartago session and then records the operation id for matching when the operation is completed.

The recordOperation(...) and notifyCartagoEvent methods have been synchronised in an effort to stop this, but the operation executor thread is spawned before the action execution thread enters the critical area. This means that the operation can complete BEFORE the operation is registered leading to the freeze.

This has been fixed by moving the code to invoke the operation into a synchronized method within the CartagoAPI. This stops the freeze occcurring.