retry the quick connect startup probe, and exit non-zero when a start fails
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful

This commit is contained in:
2026-09-26 22:14:14 +10:00
parent 624d528d28
commit 6c7f76fd26
8 changed files with 312 additions and 64 deletions
@@ -10,9 +10,14 @@ using StackExchange.Redis;
namespace Emby.Server.Implementations.MediaEncoding;
/// <summary>
/// Pings the configured Redis transcode session store once at startup so an unreachable store is
/// reported there instead of being discovered as a silent loss of cross-pod takeover.
/// Reports the round trip to the configured Redis transcode session store once at startup, so the
/// state of cross-pod takeover is visible where the server is started.
/// </summary>
/// <remarks>
/// This reports, it does not gate. <see cref="ApplicationHost.InitializeServices"/> has already read the
/// same connection for quick connect by the time this runs and has stopped startup if it could not be
/// reached, so the error branch here only covers a store that went away in between.
/// </remarks>
public sealed class TranscodeStoreConnectivityProbe : IHostedService
{
private readonly IServiceProvider _serviceProvider;
@@ -34,7 +39,7 @@ public sealed class TranscodeStoreConnectivityProbe : IHostedService
{
try
{
// Resolved here rather than injected: connecting must not be able to abort startup.
// Resolved here rather than injected so a store lost after the quick connect gate is reported.
var redis = _serviceProvider.GetRequiredService<IConnectionMultiplexer>();
var roundTrip = await redis.GetDatabase().PingAsync().ConfigureAwait(false);