Одиночный сбой очистки helper навсегда занимает слот подключения

Open
#342 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
csharp
Domain
backend

Research direction

Start with HelperSession.cs:87–97, HelperServer.cs:46–66, and HelperLeasePool.cs:9–14; trace how cleanup failures affect the lease and session directory. Reproduce the failure with a fake StopAsync that throws once, then check that a retry can complete cleanup and a later session can acquire the slot. Done means failed cleanup remains retryable, and file deletion after a confirmed engine stop does not block new connections.

Written by the indexing model from the issue text.

Description

bug network

Приоритет P1 · milestone 0.4.1

Если остановка движка или удаление каталога сессии помощника завершится исключением, последующие подключения могут получать «A privileged engine already owns this resource» до перезапуска помощника.

Воспроизведение с фейком

  1. Занять слот через HelperSession.
  2. Закрыть клиентскую сессию, заставив фейковый StopAsync один раз выбросить исключение.
  3. Попробовать занять слот второй сессией. Первая очистка не повторяется и захват отклоняется.

Причина: HelperSession.cs:87–97 выполняет остановку, Dispose и удаление каталога последовательно, освобождая lease в самом конце. HelperServer.cs:63–66 ожидает Dispose один раз, а :46–52 только логирует ошибку завершённой задачи и теряет ссылку. HelperLeasePool.cs:9–14 продолжает отклонять новые подключения.

Доказательство: изолированный прогон получил A privileged engine already owns this resource. StopAttempts=1; old session directory remains=True.

Ожидаемо: сбой очистки остаётся доступен для повторной попытки. После подтверждённой остановки движка временная ошибка удаления файлов не блокирует все последующие подключения.

Направление исправления: удерживать состояние незавершённой очистки для повторов. Разделить освобождение слота после безопасной остановки и отдельное удаление каталога сессии.

Связано: #257, #182.

Аудит ffa65648867139f9e45c15f4b635a83c1ff52c1b.

Dominant language
C#
Stars
5
Forks
1
Avg merge
23m
Merged PRs (30d)
144

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from endercodezz/BYDLO

All issues in endercodezz/BYDLO

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.