Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions plugins/source/scheduler_dfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,19 @@ func (p *Plugin) syncDfs(ctx context.Context, spec specs.Source, client schema.C
if table.Multiplex != nil {
clients = table.Multiplex(client)
}
// Detect duplicate clients while multiplexing
seenClients := make(map[string]bool)
for _, c := range clients {
if _, ok := seenClients[c.ID()]; !ok {
seenClients[c.ID()] = true
} else {
sentry.WithScope(func(scope *sentry.Scope) {
scope.SetTag("table", table.Name)
sentry.CurrentHub().CaptureMessage("duplicate client ID in " + table.Name)
})
p.logger.Warn().Str("client", c.ID()).Str("table", table.Name).Msg("multiplex returned duplicate client")
}
}
preInitialisedClients[i] = clients
// we do this here to avoid locks so we initial the metrics structure once in the main goroutines
// and then we can just read from it in the other goroutines concurrently given we are not writing to it.
Expand Down