Merge pull request #4 from HueByte/dev

fix: Improve shutdown process for IRC Gateway and Server Directory se…
This commit is contained in:
Hue
2026-02-19 12:31:38 +01:00
committed by GitHub
6 changed files with 30 additions and 11 deletions
+1
View File
@@ -4,6 +4,7 @@ Release history for EchoHub.
## Releases
- [v0.2.1](v0.2.1.md) - Shutdown & CI Fixes
- [v0.2.0](v0.2.0.md) - IRC Gateway
- [v0.1.1](v0.1.1.md) - Directory Connection Self-Healing
- [v0.1.0](v0.1.0.md) - Initial Release
+2
View File
@@ -1,5 +1,7 @@
- name: Overview
href: index.md
- name: v0.2.1
href: v0.2.1.md
- name: v0.2.0
href: v0.2.0.md
- 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>
<PropertyGroup>
<Version>0.1.1</Version>
<Version>0.2.1</Version>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn);CS1591</NoWarn>
</PropertyGroup>
+11 -4
View File
@@ -141,17 +141,24 @@ public sealed class IrcGatewayService : BackgroundService
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)
{
try
{
await conn.SendAsync("ERROR :Server shutting down");
await conn.DisposeAsync();
await conn.SendAsync("ERROR :Server shutting down")
.WaitAsync(TimeSpan.FromSeconds(2));
}
catch { }
finally
{
try { await conn.DisposeAsync(); }
catch { }
}
}
_connections.Clear();
await base.StopAsync(cancellationToken);
}
}
@@ -177,13 +177,9 @@ public sealed class ServerDirectoryService(
public override async Task StopAsync(CancellationToken cancellationToken)
{
if (_connection is not null)
{
await _connection.DisposeAsync();
_connection = null;
}
// Cancel ExecuteAsync first — it disposes the connection via await using
await base.StopAsync(cancellationToken);
_connection = null;
}
/// <summary>