When a container (Jubatus server) become Wait status, it reports its status to ApplicationMaster. In changeWait method of ApplicationMaster, if status of all (currently two) containers become Wait, status of AM become Wait and reports the status to Jubatus-on-Yarn client.
However, as changeWait may be called asynchronously (from two Containers), there is a race condition around L99-L102 that AM status change be notified twice to Jubatus-on-Yarn client. The second status notification will fail, because state cannot be changed from Wait to Wait. As a consequence, 1 of Jubatus server container will occasionally go down.
We should make changeWait synchronized.
When a container (Jubatus server) become Wait status, it reports its status to ApplicationMaster. In
changeWaitmethod of ApplicationMaster, if status of all (currently two) containers become Wait, status of AM become Wait and reports the status to Jubatus-on-Yarn client.However, as
changeWaitmay be called asynchronously (from two Containers), there is a race condition around L99-L102 that AM status change be notified twice to Jubatus-on-Yarn client. The second status notification will fail, because state cannot be changed from Wait to Wait. As a consequence, 1 of Jubatus server container will occasionally go down.We should make
changeWaitsynchronized.