-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnodehost.go
700 lines (642 loc) · 17.8 KB
/
nodehost.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
package paxos
import (
"context"
"errors"
"reflect"
"sync"
"sync/atomic"
"time"
"github.com/LiuzhouChan/go-paxos/config"
"github.com/LiuzhouChan/go-paxos/internal/logdb"
"github.com/LiuzhouChan/go-paxos/internal/rsm"
"github.com/LiuzhouChan/go-paxos/internal/server"
"github.com/LiuzhouChan/go-paxos/internal/settings"
"github.com/LiuzhouChan/go-paxos/internal/transport"
"github.com/LiuzhouChan/go-paxos/internal/utils/lang"
"github.com/LiuzhouChan/go-paxos/internal/utils/logutil"
"github.com/LiuzhouChan/go-paxos/internal/utils/stringutil"
"github.com/LiuzhouChan/go-paxos/internal/utils/syncutil"
"github.com/LiuzhouChan/go-paxos/paxosio"
"github.com/LiuzhouChan/go-paxos/paxospb"
"github.com/LiuzhouChan/go-paxos/statemachine"
)
const (
//PaxosMajor ...
PaxosMajor = 0
//PaxosMinor ...
PaxosMinor = 0
//PaxosPatch ...
PaxosPatch = 1
// DEVVersion is a boolean value to indicate whether this is a dev version
DEVVersion = true
)
var (
delaySampleRatio uint64 = settings.Soft.LatencySampleRatio
streamConnections = settings.Soft.StreamConnections
rsPoolSize = settings.Soft.NodeHostSyncPoolSize
monitorInterval = 100 * time.Millisecond
receiveQueueSize uint64 = settings.Soft.PaxosNodeReceiveQueueLength
)
var (
ErrGroupNotFound = errors.New("group not found")
ErrGroupAlreadyExist = errors.New("group already exist")
ErrInvalidGroupSettings = errors.New("group settings are invalid")
ErrDeadlineNotSet = errors.New("deadline not set")
ErrInvalidDeadline = errors.New("invalid deadline")
)
//NodeHost ...
type NodeHost struct {
tick uint64
msgCount uint64
groupMu struct {
sync.RWMutex
stopped bool
gsi uint64
groups sync.Map
requests map[uint64]*server.MessageQueue
}
cancel context.CancelFunc
serverCtx *server.Context
nhConfig config.NodeHostConfig
stopper *syncutil.Stopper
duStopper *syncutil.Stopper
nodes *transport.Nodes
rsPool []*sync.Pool
execEngine *execEngine
logdb paxosio.ILogDB
transport transport.ITransport
msgHandler *messageHandler
initializedC chan struct{}
transportLatency *sample
}
//NewNodeHost ...
func NewNodeHost(nhConfig config.NodeHostConfig) *NodeHost {
nh := &NodeHost{
serverCtx: server.NewContext(nhConfig),
nhConfig: nhConfig,
stopper: syncutil.NewStopper(),
duStopper: syncutil.NewStopper(),
nodes: transport.NewNodes(streamConnections),
initializedC: make(chan struct{}),
transportLatency: newSample(),
}
nh.msgHandler = newNodeHostMessageHandler(nh)
nh.groupMu.requests = make(map[uint64]*server.MessageQueue)
nh.createPools()
nh.createTransport()
plog.Infof("running in the standalone mode")
nh.createLogDB(nhConfig)
ctx, cancel := context.WithCancel(context.Background())
nh.cancel = cancel
initializeFn := func() {
if err := nh.initialize(ctx, nhConfig); err != nil {
if err != context.Canceled && err != ErrCanceled {
plog.Panicf("nh.initialize failed %v", err)
}
}
}
initializeFn()
nh.stopper.RunWorker(func() {
nh.nodeMonitorMain(ctx, nhConfig)
})
nh.stopper.RunWorker(func() {
nh.tickWorkerMain()
})
return nh
}
//NodeHostConfig ...
func (nh *NodeHost) NodeHostConfig() config.NodeHostConfig {
return nh.nhConfig
}
//PaxosAddress ...
func (nh *NodeHost) PaxosAddress() string {
return nh.nhConfig.PaxosAddress
}
//Stop ...
func (nh *NodeHost) Stop() {
nh.groupMu.Lock()
nh.groupMu.stopped = true
nh.groupMu.Unlock()
nh.transport.RemoveMessageHandler()
allNodes := make([]paxosio.NodeInfo, 0)
nh.forEachGroup(func(cid uint64, node *node) bool {
nodeInfo := paxosio.NodeInfo{
GroupID: node.groupID,
NodeID: node.nodeID,
}
allNodes = append(allNodes, nodeInfo)
return true
})
for _, node := range allNodes {
if err := nh.StopNode(node.GroupID, node.NodeID); err != nil {
plog.Errorf("failed to remove group %s", logutil.GroupID(node.GroupID))
}
}
nh.cancel()
plog.Debugf("%s is going to stop the nh stopper", nh.describe())
if nh.duStopper != nil {
nh.duStopper.Stop()
}
nh.stopper.Stop()
plog.Debugf("%s is going to stop the exec engine", nh.describe())
if nh.execEngine != nil {
nh.execEngine.stop()
}
plog.Debugf("%s is going to stop the transport module", nh.describe())
nh.transport.Stop()
plog.Debugf("%s transport module stopped", nh.describe())
if nh.logdb != nil {
nh.logdb.Close()
} else {
plog.Warningf("logdb not closed")
}
plog.Debugf("logdb closed, %s is now stopped", nh.describe())
}
//StartGroup ...
func (nh *NodeHost) StartGroup(nodes map[uint64]string, join bool,
createStateMachine func(uint64, uint64) statemachine.IStateMachine,
config config.Config) error {
stopc := make(chan struct{})
cf := func(groupID uint64, nodeID uint64,
done <-chan struct{}) rsm.IManagedStateMachine {
sm := createStateMachine(groupID, nodeID)
return rsm.NewNativeStateMachine(sm, done)
}
return nh.startGroup(nodes, join, cf, stopc, config)
}
//SyncPropose ...
func (nh *NodeHost) SyncPropose(ctx context.Context, groupID uint64,
cmd []byte) (uint64, error) {
timeout, err := getTimeoutFromContext(ctx)
if err != nil {
return 0, err
}
rs, err := nh.Propose(groupID, cmd, timeout)
if err != nil {
return 0, err
}
select {
case s := <-rs.CompletedC:
if s.Timeout() {
return 0, ErrTimeout
} else if s.Completed() {
rs.Release()
return s.GetResult(), nil
} else if s.Terminated() {
return 0, ErrGroupClosed
} else if s.Rejected() {
return 0, ErrInvalidSession
}
panic("unknow CompletedC value")
case <-ctx.Done():
if ctx.Err() == context.Canceled {
return 0, ErrCanceled
} else if ctx.Err() == context.DeadlineExceeded {
return 0, ErrTimeout
}
panic("unknow ctx error")
}
}
// ReadLocalNode queries the paxos node identified by the input RequestState
// instance.
func (nh *NodeHost) ReadLocalNode(groupID uint64, query []byte) ([]byte, error) {
v, ok := nh.getGroupNotLocked(groupID)
if !ok {
return nil, ErrGroupNotFound
}
data, err := v.sm.Lookup(query)
if err == rsm.ErrGroupClosed {
return nil, ErrGroupClosed
}
return data, err
}
func (nh *NodeHost) getGroupNotLocked(groupID uint64) (*node, bool) {
v, ok := nh.groupMu.groups.Load(groupID)
if !ok {
return nil, false
}
return v.(*node), true
}
func (nh *NodeHost) getGroupAndQueueNotLocked(groupID uint64) (*node,
*server.MessageQueue, bool) {
nh.groupMu.RLock()
defer nh.groupMu.RUnlock()
v, ok := nh.getGroupNotLocked(groupID)
if !ok {
return nil, nil, false
}
q, ok := nh.groupMu.requests[groupID]
if !ok {
return nil, nil, false
}
return v, q, true
}
func (nh *NodeHost) getGroup(groupID uint64) (*node, bool) {
nh.groupMu.RLock()
v, ok := nh.groupMu.groups.Load(groupID)
nh.groupMu.RUnlock()
if !ok {
return nil, false
}
return v.(*node), true
}
func (nh *NodeHost) forEachGroupRun(bf func() bool, af func() bool,
f func(uint64, *node) bool) {
nh.groupMu.RLock()
defer nh.groupMu.RUnlock()
if bf != nil {
if !bf() {
return
}
}
nh.groupMu.groups.Range(func(k, v interface{}) bool {
return f(k.(uint64), v.(*node))
})
if af != nil {
if !af() {
return
}
}
}
func (nh *NodeHost) forEachGroup(f func(uint64, *node) bool) {
nh.forEachGroupRun(nil, nil, f)
}
//Propose ...
func (nh *NodeHost) Propose(grouID uint64, cmd []byte,
timeout time.Duration) (*RequestState, error) {
return nh.propose(grouID, cmd, nil, timeout)
}
func (nh *NodeHost) propose(groupID uint64, cmd []byte, handler ICompleteHandler,
timeout time.Duration) (*RequestState, error) {
c, ok := nh.groupMu.groups.Load(groupID)
if !ok {
return nil, ErrGroupNotFound
}
v := c.(*node)
req, err := v.propose(cmd, handler, timeout)
nh.execEngine.setNodeReady(groupID)
return req, err
}
func (nh *NodeHost) createPools() {
nh.rsPool = make([]*sync.Pool, rsPoolSize)
for i := uint64(0); i < rsPoolSize; i++ {
p := &sync.Pool{}
p.New = func() interface{} {
obj := &RequestState{}
obj.CompletedC = make(chan RequestResult, 1)
obj.pool = p
return obj
}
nh.rsPool[i] = p
}
}
func (nh *NodeHost) createLogDB(nhConfig config.NodeHostConfig) {
nhDirs, walDisr := nh.serverCtx.CreateNodeHostDir()
nh.serverCtx.CheckNodeHostDir(nh.nhConfig.PaxosAddress)
var factory config.LogDBFactoryFunc
if nhConfig.LogDBFactory != nil {
factory = nhConfig.LogDBFactory
} else {
factory = logdb.OpenLogDB
}
logdb, err := factory(nhDirs, walDisr)
if err != nil {
panic(err)
}
plog.Infof("logdb type name: %s", logdb.Name())
nh.logdb = logdb
}
func (nh *NodeHost) createTransport() {
nh.transport = transport.NewTransport(nh.nhConfig, nh.serverCtx, nh.nodes)
nh.transport.SetMessageHandler(nh.msgHandler)
}
func (nh *NodeHost) stopNode(groupID uint64, nodeID uint64, nodeCheck bool) error {
nh.groupMu.Lock()
defer nh.groupMu.Unlock()
v, ok := nh.groupMu.groups.Load(groupID)
if !ok {
return ErrGroupNotFound
}
group := v.(*node)
if nodeCheck && group.nodeID != nodeID {
return ErrGroupNotFound
}
nh.groupMu.groups.Delete(groupID)
delete(nh.groupMu.requests, groupID)
nh.groupMu.gsi++
group.notifyOffloaded(rsm.FromNodeHost)
return nil
}
func (nh *NodeHost) initialize(ctx context.Context,
nhConfig config.NodeHostConfig) error {
nh.execEngine = newExecEngine(nh, nh.serverCtx, nh.logdb, nh.sendNoOPMessage)
nh.setInitialized()
return nil
}
func (nh *NodeHost) tickWorkerMain() {
count := uint64(0)
idx := uint64(0)
nodes := make([]*node, 0)
qs := make(map[uint64]*server.MessageQueue)
tf := func() bool {
count++
nh.increateTick()
if count%nh.nhConfig.RTTMillisecond == 0 {
// one RTT
idx, nodes, qs = nh.getCurrentGroups(idx, nodes, qs)
nh.sendTickMessage(nodes, qs)
}
return false
}
lang.RunTicker(time.Millisecond, tf, nh.stopper.ShouldStop(), nil)
}
func (nh *NodeHost) getCurrentGroups(index uint64,
groups []*node, queues map[uint64]*server.MessageQueue) (uint64,
[]*node, map[uint64]*server.MessageQueue) {
newIndex := nh.getGroupSetIndex()
if newIndex == index {
return index, groups, queues
}
newGroups := groups[:0]
newQueues := make(map[uint64]*server.MessageQueue)
nh.forEachGroup(func(gid uint64, node *node) bool {
newGroups = append(newGroups, node)
v, ok := nh.groupMu.requests[gid]
if !ok {
panic("inconsistent received messageC map")
}
newQueues[gid] = v
return true
})
return newIndex, newGroups, newQueues
}
func (nh *NodeHost) asyncSendPaxosRequest(msg paxospb.PaxosMsg) {
nh.transport.ASyncSend(msg)
}
func (nh *NodeHost) sendTickMessage(groups []*node,
queues map[uint64]*server.MessageQueue) {
m := paxospb.PaxosMsg{MsgType: paxospb.LocalTick}
for _, n := range groups {
q, ok := queues[n.groupID]
if !ok || !nh.initialized() {
continue
}
q.Add(m)
nh.execEngine.setNodeReady(n.groupID)
}
}
func (nh *NodeHost) sendNoOPMessage(groupID, NodeID uint64) {
batch := paxospb.MessageBatch{
Requests: make([]paxospb.PaxosMsg, 0),
}
msg := paxospb.PaxosMsg{
MsgType: paxospb.NoOP,
To: NodeID,
From: NodeID,
GroupID: groupID,
}
batch.Requests = append(batch.Requests, msg)
nh.msgHandler.HandleMessageBatch(batch)
}
func (nh *NodeHost) closeStoppedGroups() {
chans := make([]<-chan struct{}, 0)
keys := make([]uint64, 0)
nodeIDs := make([]uint64, 0)
nh.forEachGroup(func(gid uint64, node *node) bool {
chans = append(chans, node.shouldStop())
keys = append(keys, gid)
nodeIDs = append(nodeIDs, node.nodeID)
return true
})
if len(chans) == 0 {
return
}
cases := make([]reflect.SelectCase, len(chans)+1)
for i, ch := range chans {
cases[i] = reflect.SelectCase{
Dir: reflect.SelectRecv,
Chan: reflect.ValueOf(ch),
}
}
cases[len(chans)] = reflect.SelectCase{Dir: reflect.SelectDefault}
chosen, _, ok := reflect.Select(cases)
for !ok && chosen < len(keys) {
groupID := keys[chosen]
nodeID := nodeIDs[chosen]
if err := nh.StopNode(groupID, nodeID); err != nil {
plog.Errorf("failed to remove group %d", groupID)
}
}
}
func (nh *NodeHost) nodeMonitorMain(ctx context.Context,
nhConfig config.NodeHostConfig) {
count := uint64(0)
tf := func() bool {
count++
nh.closeStoppedGroups()
return false
}
lang.RunTicker(monitorInterval, tf, nh.stopper.ShouldStop(), nil)
}
//StopGroup ...
func (nh *NodeHost) StopGroup(groupID uint64) error {
return nh.stopNode(groupID, 0, false)
}
//StopNode ...
func (nh *NodeHost) StopNode(groupID uint64, nodeID uint64) error {
return nh.stopNode(groupID, nodeID, true)
}
func (nh *NodeHost) initialized() bool {
select {
case <-nh.initializedC:
return true
default:
return false
}
}
func (nh *NodeHost) waitUntilInitialized() {
<-nh.initializedC
}
func (nh *NodeHost) setInitialized() {
close(nh.initializedC)
}
func (nh *NodeHost) increateTick() {
atomic.AddUint64(&nh.tick, 1)
}
func (nh *NodeHost) getTick() uint64 {
return atomic.LoadUint64(&nh.tick)
}
func (nh *NodeHost) getGroupSetIndex() uint64 {
nh.groupMu.RLock()
v := nh.groupMu.gsi
nh.groupMu.RUnlock()
return v
}
func (nh *NodeHost) describe() string {
return nh.PaxosAddress()
}
func (nh *NodeHost) logNodeHostDetails() {
if nh.transport != nil {
plog.Infof("transport type: %s", nh.transport.Name())
}
if nh.logdb != nil {
plog.Infof("logdb type: %s", nh.logdb.Name())
}
plog.Infof("nodehost address: %s", nh.nhConfig.PaxosAddress)
}
func (nh *NodeHost) bootstrapGroup(nodes map[uint64]string,
join bool, config config.Config) (map[uint64]string, bool, error) {
binfo, err := nh.logdb.GetBootstrapInfo(config.GroupID, config.NodeID)
if err == paxosio.ErrNoBootstrapInfo {
var members map[uint64]string
if !join {
members = nodes
}
bootstrap := paxospb.Bootstrap{
Join: join,
Addresses: make(map[uint64]string),
}
for nid, addr := range nodes {
bootstrap.Addresses[nid] = stringutil.CleanAddress(addr)
}
err = nh.logdb.SaveBootstrapInfo(config.GroupID, config.NodeID, bootstrap)
plog.Infof("bootstrap for %s found node not bootstrapped, %v",
logutil.DescribeNode(config.GroupID, config.NodeID), members)
return members, !join, err
}
plog.Infof("bootstrap for %s returns %v", logutil.DescribeNode(config.GroupID, config.NodeID),
binfo.Addresses)
return binfo.Addresses, !join, nil
}
func (nh *NodeHost) startGroup(nodes map[uint64]string,
join bool,
createStateMachine rsm.ManagedStateMachineFactory,
stopc chan struct{},
config config.Config) error {
groupID := config.GroupID
nodeID := config.NodeID
plog.Infof("start group called for %s, join %t, nodes %v",
logutil.DescribeNode(groupID, nodeID), join, nodes)
nh.groupMu.Lock()
defer nh.groupMu.Unlock()
if nh.groupMu.stopped {
return ErrSystemStopped
}
if _, ok := nh.groupMu.groups.Load(groupID); ok {
return ErrGroupAlreadyExist
}
if join && len(nodes) > 0 {
plog.Errorf("trying to join %s with initial member list %v",
logutil.DescribeNode(groupID, nodeID), nodes)
return ErrInvalidGroupSettings
}
addresses, initialMember, err := nh.bootstrapGroup(nodes, join, config)
if err == ErrInvalidGroupSettings {
return ErrInvalidGroupSettings
}
if err != nil {
panic(err)
}
plog.Infof("bootstrap for %s returned address list %v",
logutil.DescribeNode(groupID, nodeID), addresses)
queue := server.NewMessageQueue(receiveQueueSize, false, lazyFreeCycle)
for k, v := range addresses {
if k != nodeID {
plog.Infof("AddNode called with node %s, addr %s",
logutil.DescribeNode(groupID, nodeID), addresses)
nh.nodes.AddNode(groupID, k, v)
}
}
rn := newNode(nh.nhConfig.PaxosAddress,
addresses,
initialMember,
createStateMachine(groupID, nodeID, stopc),
nh.execEngine.SetCommitReady,
nh.asyncSendPaxosRequest,
queue,
stopc,
nh.nodes,
nh.rsPool[nodeID%rsPoolSize],
config,
nh.nhConfig.RTTMillisecond,
nh.logdb)
nh.groupMu.groups.Store(groupID, rn)
nh.groupMu.requests[groupID] = queue
nh.groupMu.gsi++
return nil
}
// GetNodeUser returns an INodeUser instance ready to be used to directly make
// proposals.
func (nh *NodeHost) GetNodeUser(groupID uint64) (INodeUser, error) {
v, ok := nh.getGroup(groupID)
if !ok {
return nil, ErrGroupNotFound
}
nu := &nodeUser{
nh: nh,
node: v,
setNodeReady: nh.execEngine.setNodeReady,
}
return nu, nil
}
// HasNodeInfo returns a boolean value indicating whether the specified node
// has been bootstrapped on the current NodeHost instance.
func (nh *NodeHost) HasNodeInfo(groupID uint64, nodeID uint64) bool {
_, err := nh.logdb.GetBootstrapInfo(groupID, nodeID)
if err == paxosio.ErrNoBootstrapInfo {
return false
}
if err != nil {
panic(err)
}
return true
}
// INodeUser is the interface implemented by a Paxos node user type. A Paxos node
// user can be used to directly initiate proposals operations
// without locating the Paxos node in NodeHost's node list first. It is useful
// when doing bulk load operations on selected groups.
type INodeUser interface {
Propose(groupID uint64, cmd []byte,
timeout time.Duration) (*RequestState, error)
}
type nodeUser struct {
nh *NodeHost
node *node
setNodeReady func(groupID uint64)
}
func (nu *nodeUser) Propose(groupID uint64, cmd []byte,
timeout time.Duration) (*RequestState, error) {
req, err := nu.node.propose(cmd, nil, timeout)
nu.setNodeReady(groupID)
return req, err
}
func getTimeoutFromContext(ctx context.Context) (time.Duration, error) {
d, ok := ctx.Deadline()
if !ok {
return 0, ErrDeadlineNotSet
}
now := time.Now()
if now.After(d) {
return 0, ErrInvalidDeadline
}
return d.Sub(now), nil
}
type messageHandler struct {
nh *NodeHost
}
func newNodeHostMessageHandler(nh *NodeHost) *messageHandler {
return &messageHandler{nh: nh}
}
func (h *messageHandler) HandleMessageBatch(msg paxospb.MessageBatch) {
nh := h.nh
for _, req := range msg.Requests {
_, q, ok := nh.getGroupAndQueueNotLocked(req.GroupID)
if ok {
// here we only deal with the regular message
if added, stopped := q.Add(req); !added || stopped {
plog.Warningf("dropped an incomming message")
}
}
nh.execEngine.setNodeReady(req.GroupID)
}
}