File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
src/main/java/org/elasticsearch/cluster/service Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -189,19 +189,19 @@ public void remove(LocalNodeMasterListener listener) {
189189 localNodeMasterListeners .remove (listener );
190190 }
191191
192- public void add (TimeValue timeout , final TimeoutClusterStateListener listener ) {
192+ public void add (final TimeValue timeout , final TimeoutClusterStateListener listener ) {
193193 if (lifecycle .stoppedOrClosed ()) {
194194 listener .onClose ();
195195 return ;
196196 }
197- NotifyTimeout notifyTimeout = new NotifyTimeout (listener , timeout );
198- notifyTimeout .future = threadPool .schedule (timeout , ThreadPool .Names .GENERIC , notifyTimeout );
199- onGoingTimeouts .add (notifyTimeout );
200- clusterStateListeners .add (listener );
201197 // call the post added notification on the same event thread
202198 updateTasksExecutor .execute (new Runnable () {
203199 @ Override
204200 public void run () {
201+ NotifyTimeout notifyTimeout = new NotifyTimeout (listener , timeout );
202+ notifyTimeout .future = threadPool .schedule (timeout , ThreadPool .Names .GENERIC , notifyTimeout );
203+ onGoingTimeouts .add (notifyTimeout );
204+ clusterStateListeners .add (listener );
205205 listener .postAdded ();
206206 }
207207 });
You can’t perform that action at this time.
0 commit comments