Skip to content

praefect: Fix logging data race when creating connectivity checks

When chreating a new connectivity check, then we'll always configure the logger first. This is not something we really need to do though: this function is only used when executing Praefect's "check" subcommand, and we have configured the logger immediately before executing subcommands already. In fact, it's even actively harmful: anything which is already using the logger may now race against the reconfiguration of the global logging instance. This data race is something we have in fact already observed in our tests, where the reconfiguration races with an already established gRPC connection which tries to log information.

Fix this data race by just not reconfiguring the logger: we already do so anyway, and we can just use log.Default() to get the already configured logger instance.

Merge request reports