MCPcopy Index your code
hub / github.com/coder/coder / coordinate

Method coordinate

tailnet/controllers.go:1703–1727  ·  view source on GitHub ↗
(client CoordinatorClient)

Source from the content-addressed store, hash-verified

1701}
1702
1703func (c *Controller) coordinate(client CoordinatorClient) {
1704 defer func() {
1705 cErr := client.Close()
1706 if cErr != nil {
1707 c.logger.Debug(c.ctx, "error closing Coordinate RPC", slog.Error(cErr))
1708 }
1709 }()
1710 coordination := c.CoordCtrl.New(client)
1711 c.logger.Debug(c.ctx, "serving coordinator")
1712 select {
1713 case <-c.ctx.Done():
1714 c.logger.Debug(c.ctx, "main context canceled; do graceful disconnect")
1715 crdErr := coordination.Close(c.gracefulCtx)
1716 if crdErr != nil {
1717 c.logger.Warn(c.ctx, "failed to close remote coordination", slog.Error(crdErr))
1718 }
1719 case err := <-coordination.Wait():
1720 if err != nil &&
1721 !xerrors.Is(err, io.EOF) &&
1722 !xerrors.Is(err, context.Canceled) &&
1723 !xerrors.Is(err, context.DeadlineExceeded) {
1724 c.logger.Error(c.ctx, "remote coordination error", slog.Error(err))
1725 }
1726 }
1727}
1728
1729func (c *Controller) derpMap(client DERPClient) error {
1730 defer func() {

Callers 1

runControllersOnceMethod · 0.95

Calls 6

CloseMethod · 0.65
NewMethod · 0.65
WaitMethod · 0.65
ErrorMethod · 0.45
DoneMethod · 0.45
IsMethod · 0.45

Tested by

no test coverage detected