Compare commits

3 Commits
Author SHA1 Message Date
Hue 87e8df4ec5 Merge pull request #4 from HueByte/dev
fix: Improve shutdown process for IRC Gateway and Server Directory se…
2026-02-19 12:31:38 +01:00
HueByte 4c192717de feat: Release v0.2.1 with shutdown and CI fixes 2026-02-19 12:29:45 +01:00
HueByte 1bf32450fd fix: Improve shutdown process for IRC Gateway and Server Directory services 2026-02-19 12:25:33 +01:00
6 changed files with 30 additions and 11 deletions
+1
View File
@@ -4,6 +4,7 @@ Release history for EchoHub.
## Releases ## Releases
- [v0.2.1](v0.2.1.md) - Shutdown & CI Fixes
- [v0.2.0](v0.2.0.md) - IRC Gateway - [v0.2.0](v0.2.0.md) - IRC Gateway
- [v0.1.1](v0.1.1.md) - Directory Connection Self-Healing - [v0.1.1](v0.1.1.md) - Directory Connection Self-Healing
- [v0.1.0](v0.1.0.md) - Initial Release - [v0.1.0](v0.1.0.md) - Initial Release
+2
View File
@@ -1,5 +1,7 @@
- name: Overview - name: Overview
href: index.md href: index.md
- name: v0.2.1
href: v0.2.1.md
- name: v0.2.0 - name: v0.2.0
href: v0.2.0.md href: v0.2.0.md
- name: v0.1.1 - name: v0.1.1
+13
View File
@@ -0,0 +1,13 @@
# v0.2.1 - Shutdown & CI Fixes
## Fixes
- Fixed server hanging on Ctrl+C when the directory server is unreachable — `StopAsync` now cancels background services before disposing connections
- Fixed IRC gateway shutdown blocking indefinitely on unresponsive clients — send operations are now bounded to 2 seconds
- Fixed CI release workflow not having full git history for building release notes (`fetch-depth: 0`)
- Fixed `workflow_dispatch` trigger breaking change detection when `github.event.before` is empty
## Improvements
- GitHub releases now include a commit list and version diff link instead of generic auto-generated notes
- GitHub releases link to the full changelog on the docs site
+1 -1
View File
@@ -1,6 +1,6 @@
<Project> <Project>
<PropertyGroup> <PropertyGroup>
<Version>0.1.1</Version> <Version>0.2.1</Version>
<GenerateDocumentationFile>true</GenerateDocumentationFile> <GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn);CS1591</NoWarn> <NoWarn>$(NoWarn);CS1591</NoWarn>
</PropertyGroup> </PropertyGroup>
+11 -4
View File
@@ -141,17 +141,24 @@ public sealed class IrcGatewayService : BackgroundService
public override async Task StopAsync(CancellationToken cancellationToken) public override async Task StopAsync(CancellationToken cancellationToken)
{ {
// Cancel ExecuteAsync first so listeners stop accepting
await base.StopAsync(cancellationToken);
// Force-close any remaining client connections
foreach (var (_, conn) in _connections) foreach (var (_, conn) in _connections)
{ {
try try
{ {
await conn.SendAsync("ERROR :Server shutting down"); await conn.SendAsync("ERROR :Server shutting down")
await conn.DisposeAsync(); .WaitAsync(TimeSpan.FromSeconds(2));
} }
catch { } catch { }
finally
{
try { await conn.DisposeAsync(); }
catch { }
}
} }
_connections.Clear(); _connections.Clear();
await base.StopAsync(cancellationToken);
} }
} }
@@ -177,13 +177,9 @@ public sealed class ServerDirectoryService(
public override async Task StopAsync(CancellationToken cancellationToken) public override async Task StopAsync(CancellationToken cancellationToken)
{ {
if (_connection is not null) // Cancel ExecuteAsync first — it disposes the connection via await using
{
await _connection.DisposeAsync();
_connection = null;
}
await base.StopAsync(cancellationToken); await base.StopAsync(cancellationToken);
_connection = null;
} }
/// <summary> /// <summary>