예제 #1
0
        /// <inheritdoc />
        protected override async Task <BoolResult> ShutdownCoreAsync(OperationContext context)
        {
            _serviceReadinessChecker.Reset();

            _portDisposer?.Dispose();

            if (_grpcServer != null)
            {
                await _grpcServer.KillAsync();
            }

            _logIncrementalStatsTimer?.Dispose();
            await LogIncrementalStatsAsync(context);

            // Stop the session expiration timer.
            _sessionExpirationCheckTimer?.Dispose();

            // Hibernate dangling sessions in case we are shutdown unexpectedly to live clients.
            await HandleShutdownDanglingSessionsAsync(context);

            // Cleaning up all the temp directories associated with sessions (they'll be recreated during the next startup when hibernated sessions are recreated).
            CleanSessionTempDirectories(context);

            // Now the stores, without active users, can be shut down.
            return(await ShutdownStoresAsync(context));
        }
예제 #2
0
        /// <inheritdoc />
        protected override async Task <BoolResult> ShutdownCoreAsync(OperationContext context)
        {
            _serviceReadinessChecker.Reset();

            _portDisposer?.Dispose();
            await _grpcServer.KillAsync();

            _logIncrementalStatsTimer?.Dispose();
            await LogIncrementalStatsAsync(context);

            // Stop the session expiration timer.
            _sessionExpirationCheckTimer?.Dispose();

            // Hibernate dangling sessions in case we are shutdown unexpectedly to live clients.
            await HandleShutdownDanglingSessionsAsync(context);

            // Now the stores, without active users, can be shut down.
            return(await ShutdownStoresAsync(context));
        }
예제 #3
0
        /// <inheritdoc />
        protected override async Task <BoolResult> ShutdownCoreAsync(OperationContext context)
        {
            _serviceReadinessChecker.Reset();

            _portDisposer?.Dispose();

            if (_grpcServer != null)
            {
                await _grpcServer.KillAsync();
            }

            var success = BoolResult.Success;

            foreach (var endpoint in _additionalEndpoints)
            {
                success &= await endpoint.ShutdownAsync(context);
            }

            _logIncrementalStatsTimer?.Dispose();
            _logMachineStatsTimer?.Dispose();

            // Don't trace statistics if configured and only if startup was successful.
            if (Tracer.EnableTraceStatisticsAtShutdown && StartupCompleted)
            {
                await LogIncrementalStatsAsync(context, logAtShutdown : false);
            }

            // Stop the session expiration timer.
            _sessionExpirationCheckTimer?.Dispose();

            // Hibernate dangling sessions in case we are shutdown unexpectedly to live clients.
            await HandleShutdownDanglingSessionsAsync(context);

            // Cleaning up all the temp directories associated with sessions (they'll be recreated during the next startup when hibernated sessions are recreated).
            CleanSessionTempDirectories(context);

            // Now the stores, without active users, can be shut down.
            return(success & await ShutdownStoresAsync(context));
        }