Skip to content

[FB-261] Ban·OpsNotify가 Discord HTTP를 저장 전에 동기 대기해 최대 10초 지연 #682

Closed

Description

@boyism80

심각도

low

근거 강도

확실

대상 커밋

1a672d602 (FB-252 형제 스윕, 224회차)

위치

  • server/http/Service/DiscordNotifier.cs:10 (HttpClient.Timeout = 10s)
  • DiscordNotifier.cs:32-74 (NotifyAsync — 예외는 삼킴, 성공/타임아웃까지 await)
  • server/http/Service/BanService.cs:55-67 (Ban: LogService.WriteAsync 후 SaveChanges 전에 await _discord.NotifyAsync)
  • BanService.cs:100-109 (Unban 동일)
  • server/internal/Controllers/BanController.cs:31-32 (Ban() 반환 뒤 SaveChangesAsync)
  • server/http/Service/OpsNotifyService.cs:21-30 (Log 후 Discord await)
  • server/internal/Controllers/OpsController.cs:20-29
  • server/http/Service/ShutdownService.cs:20-26

문제

Discord 알림은 실패해도 밴·역할 변경 결과가 같아야 하는 보조 기능인데, Ban/Unban/OpsNotify/Shutdown 요청 경로에서 동기 await한다.

  • HttpClient 타임아웃 10초라 FB-252처럼 무한 hang은 아니지만, Discord API 지연·차단 시 밴 적용(SaveChanges) 자체가 최대 10초 미뤄진다(BanService가 버퍼 Set만 하고 Discord가 끝난 뒤 컨트롤러가 SaveChanges).
  • 같은 경로에서 LogService.WriteAsync(FB-252)도 먼저 await하므로, 로그 MQ hang이면 Discord까지 가지 못하고 밴이 영원히 안 끝난다(FB-252와 중첩).
  • Ops role_change 게임 호출(character.cpp:2028-2035)은 std::ignore = http.post로 task를 버려 게임 쪽은 안 기다릴 수 있음. 다만 Internal의 OpsController 요청 자체와 admin Ban 경로는 그대로 막힌다.

영향

  • Discord 장애·레이트 리밋 → GM 밴/언밴·운영 알림 HTTP가 최대 ~10초(+로그 MQ) 지연. 그사이 대상이 계속 플레이 가능.
  • 플레이어 로그인·거래소 핵심 경로에 직접 Discord 호출은 없음( Ban 로그인 검사는 Discord 없음).

수정 방향

  1. Ban/Unban: SaveChangesAsync(및 KickOut NotifySaved) 성공 후 Discord/로그를 fire-and-forget 또는 Channel 적재.
  2. OpsNotify/Shutdown: Discord를 요청 완료와 분리(BackgroundService·_ = Task.Run 금지 대신 전용 큐).
  3. Discord 비활성 시와 같이 실패는 로그만(이미 catch 있음) — 대기만 제거.

Activity

  1. boyism80 commented on Oct 16, 2026

    @boyism80
    OwnerAuthor

    [FB 리뷰어]
    ce5d1119d에서 DiscordNotifier가 Channel+HostedService로 바뀌어 NotifyAsync가 즉시 반환합니다. Ban/Ops의 SaveChanges 전 await는 enqueue만 하므로 Discord HTTP 최대 10초 동기 대기는 해소됐습니다. 닫습니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions