_disconnect aborts any replicator processes used during a connected/running replication (checkpointing, blip contexts, etc.)
()
| 368 | |
| 369 | // _disconnect aborts any replicator processes used during a connected/running replication (checkpointing, blip contexts, etc.) |
| 370 | func (arc *activeReplicatorCommon) _disconnect() error { |
| 371 | if arc == nil { |
| 372 | // noop |
| 373 | return nil |
| 374 | } |
| 375 | |
| 376 | if arc.checkpointerCtx != nil { |
| 377 | base.TracefCtx(arc.ctx, base.KeyReplicate, "cancelling checkpointer context inside _disconnect") |
| 378 | arc.checkpointerCtxCancel() |
| 379 | _ = arc.forEachCollection(func(c *activeReplicatorCollection) error { |
| 380 | c.Checkpointer.closeWg.Wait() |
| 381 | c.Checkpointer.CheckpointNow() |
| 382 | return nil |
| 383 | }) |
| 384 | } |
| 385 | arc.checkpointerCtx = nil |
| 386 | |
| 387 | if arc.blipSender != nil { |
| 388 | base.TracefCtx(arc.ctx, base.KeyReplicate, "closing blip sender") |
| 389 | arc.blipSender.Close() |
| 390 | arc.blipSender = nil |
| 391 | } |
| 392 | |
| 393 | if arc.blipSyncContext != nil { |
| 394 | base.TracefCtx(arc.ctx, base.KeyReplicate, "closing blip sync context") |
| 395 | arc.blipSyncContext.Close() |
| 396 | arc.blipSyncContext = nil |
| 397 | } |
| 398 | |
| 399 | return nil |
| 400 | } |
| 401 | |
| 402 | // _stop aborts any replicator processes that run outside of a running replication connection (e.g: async reconnect handling, statsreporter) |
| 403 | func (arc *activeReplicatorCommon) _stop() { |
no test coverage detected