()
| 1051 | } |
| 1052 | |
| 1053 | func (q *querier) mappingWorker() { |
| 1054 | defer q.wg.Done() |
| 1055 | defer q.logger.Debug(q.ctx, "mapping worker exited") |
| 1056 | eb := backoff.NewExponentialBackOff() |
| 1057 | eb.MaxElapsedTime = 0 // retry indefinitely |
| 1058 | eb.MaxInterval = dbMaxBackoff |
| 1059 | bkoff := backoff.WithContext(eb, q.ctx) |
| 1060 | for { |
| 1061 | allKeys, err := q.mappingQ.acquireBatch(maxBatchSize) |
| 1062 | if err != nil { |
| 1063 | return |
| 1064 | } |
| 1065 | mkeys := make([]mKey, 0, len(allKeys)) |
| 1066 | mkeys = append(mkeys, allKeys...) |
| 1067 | err = backoff.Retry(func() error { |
| 1068 | return q.mappingQuery(mkeys) |
| 1069 | }, bkoff) |
| 1070 | if err != nil { |
| 1071 | bkoff.Reset() |
| 1072 | } |
| 1073 | q.mappingQ.done(allKeys...) |
| 1074 | } |
| 1075 | } |
| 1076 | |
| 1077 | // peerUpdate is work scheduled in response to a new peer->binding. We need to find out all the |
| 1078 | // other peers that share a tunnel with the indicated peer, and then schedule a mapping update on |
no test coverage detected