fix(relay): reduce number of warnings (#7411)

With this PR, we reduce some of the warnings emitted by the relay. If we
can only partially fulfill an allocation, we now only emit a warning.

Similarly, if we receive a repeated SIGTERM signal, we shut down
successfully (i.e. exit with code 0) instead of failing the event-loop.
During normal operation, we wait for all allocations to expire before we
shut down. On CI however, the relay gets shutdown much earlier so this
would generate unnecessary errors.

Receiving another SIGTERM is a user-initiated action so we shouldn't
fail as a result but instead just comply with it.
This commit is contained in:
Thomas Eizinger
2024-11-28 23:20:10 +00:00
committed by GitHub
parent c7d46b475e
commit bea8393248
2 changed files with 4 additions and 4 deletions

View File

@@ -561,9 +561,9 @@ where
match self.sigterm.poll_recv(cx) {
Poll::Ready(Some(())) => {
if self.shutting_down {
// Received a repeated SIGTERM whilst shutting down
tracing::info!("Forcing shutdown on repeated SIGTERM");
return Poll::Ready(Err(anyhow!("Forcing shutdown on repeated SIGTERM")));
return Poll::Ready(Ok(()));
}
tracing::info!(active_allocations = %self.server.num_allocations(), "Received SIGTERM, initiating graceful shutdown");

View File

@@ -1233,7 +1233,7 @@ fn derive_relay_addresses(
// For now, we will just partially satisfy the request.
// We expect clients to gracefully handle this by only extracting the relay addresses they receive.
tracing::warn!(target: "relay", "Partially fulfilling allocation using only an IPv4 address");
tracing::debug!(target: "relay", "Partially fulfilling allocation using only an IPv4 address");
Ok((ip4.into(), None))
}
@@ -1242,7 +1242,7 @@ fn derive_relay_addresses(
// For now, we will just partially satisfy the request.
// We expect clients to gracefully handle this by only extracting the relay addresses they receive.
tracing::warn!(target: "relay", "Partially fulfilling allocation using only an IPv6 address");
tracing::debug!(target: "relay", "Partially fulfilling allocation using only an IPv6 address");
Ok((ip6.into(), None))
}