kontena / kontena-registrator

Other
0 stars 0 forks source link

Service actor exclusive mode #4

Open SpComb opened 7 years ago

SpComb commented 7 years ago

The Kontena::Registrator::Service actor is very sensitive to atomicity and ordering of the update, refresh, reload, stop tasks. Currently these presumably rely on the lack of any pre-emptable sleep/future/etc operations in these Celluloid Fiber tasks.

This is somewhat fragile, because if any operation is changed to invoke an operation pre-emptable by Celluloid (Pipelining and execution modes in ATOM mode), then this assumption may break.

Instead, the Service actor should probably use Exclusive mode. However, this is incompatible with the use of block yield receivers in the Kontena::Observable#observe API, which thus needs to be changed to sent updates as (ordered!) messages for exclusive execution.