Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
info: avoid sending messages too early.
Motivation: The info cell can send messages before the cell is properly registered. Message sending is randomised, so this does not always happen, but when it does, it can lead to errors like: java.lang.IllegalStateException: Cannot send message with callback in state \{\} \[PRE_STARTUP\] at com.google.common.base.Preconditions.checkState(Preconditions.java:199) ~\[guava-19.0.jar:na\] at dmg.cells.nucleus.CellNucleus.sendMessage(CellNucleus.java:519) ~\[cells-3.0.19-SNAPSHOT.jar:3.0.19-SNAPSHOT\] at dmg.cells.nucleus.CellAdapter.sendMessage(CellAdapter.java:468) ~\[cells-3.0.19-SNAPSHOT.jar:3.0.19-SNAPSHOT\] at org.dcache.services.info.gathers.MessageHandlerChain.sendMessage(MessageHandlerChain.java:129) ~\[dcache-info-3.0.19-SNAPSHOT.jar:3.0.19-SNAPSHOT\] at org.dcache.services.info.gathers.MessageHandlerChain.sendMessage(MessageHandlerChain.java:99) ~\[dcache-info-3.0.19-SNAPSHOT.jar:3.0.19-SNAPSHOT\] at org.dcache.services.info.gathers.SingleMessageDga.trigger(SingleMessageDga.java:83) ~\[dcache-info-3.0.19-SNAPSHOT.jar:3.0.19-SNAPSHOT\] at org.dcache.services.info.gathers.DataGatheringScheduler$RegisteredActivity.checkAndTrigger(DataGatheringScheduler.java:131) ~\[dcache-info-3.0.19-SNAPSHOT.jar:3.0.19-SNAPSHOT\] at org.dcache.services.info.gathers.DataGatheringScheduler.run(DataGatheringScheduler.java:281) ~\[dcache-info-3.0.19-SNAPSHOT.jar:3.0.19-SNAPSHOT\] at java.lang.Thread.run(Thread.java:748) ~\[na:1.8.0_131\] Modification: Only start sending messages once the cell nucleus is in POST_STARTUP phase. Result: No more IllegalStateException stack-traces about attempting to send message with callback in state PRE_STARTUP. Target: master Request: 3.1 Request: 3.0 Request: 2.16 Requires-notes: yes Requires-book: no Patch: https://rb.dcache.org/r/10234/ Acked-by: Tigran Mkrtchyan Fixes #3219
- Loading branch information