Skip to content

Fix gofmt formatting violations failing CI#1

Closed
Copilot wants to merge 5 commits intomainfrom
copilot/fix-github-actions-workflow
Closed

Fix gofmt formatting violations failing CI#1
Copilot wants to merge 5 commits intomainfrom
copilot/fix-github-actions-workflow

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 2, 2026

CI was failing on the gofmt formatting check across 9 files that had not been run through the formatter.

Changes

  • Ran gofmt -w on all offending files:
    • internal/rtmp/chunk/header.go, reader.go
    • internal/rtmp/client/client.go, doc.go
    • internal/rtmp/conn/doc.go, session.go
    • internal/rtmp/handshake/server.go
    • internal/rtmp/media/audio.go, video.go

No logic changes — formatting only.

Original prompt

Fix the failing GitHub Actions workflow Test
Analyze the workflow logs, identify the root cause of the failure, and implement a fix.
Job ID: 65454953781
Job URL: https://github.com/alxayo/rtmp-go/actions/runs/22592808727/job/65454953781


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: alxayo <2588978+alxayo@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix the failing GitHub Actions workflow Fix gofmt formatting violations failing CI Mar 2, 2026
@alxayo alxayo marked this pull request as ready for review March 2, 2026 19:53
Copilot AI and others added 3 commits March 2, 2026 20:00
…on and TestServerGracefulShutdown

Co-authored-by: alxayo <2588978+alxayo@users.noreply.github.com>
…-again

Fix server connection tracking tests: perform RTMP handshake before asserting ConnectionCount
@alxayo alxayo closed this Mar 2, 2026
alxayo added a commit that referenced this pull request Mar 3, 2026
…dlock

Wire the disconnect handler in attachCommandHandling to perform full
cleanup when a connection's readLoop exits:

- Stop MediaLogger (prevents goroutine + ticker leak per connection)
- Close FLV recorder under stream.mu lock (safe with cleanupAllRecorders)
- Call PublisherDisconnected() to clear publisher reference (fixes stream
  key lockout where stale publishers block reuse via ErrPublisherExists)
- Call SubscriberDisconnected() to remove dead subscribers
- Call RemoveConnection() to remove from s.conns (fixes memory leak where
  connections accumulated forever, only cleared on server shutdown)
- Fire publish_stop/play_stop/connection_close hook events

Add role field to commandState (set to 'publisher'/'subscriber' by
OnPublish/OnPlay handlers) to determine cleanup path.

Add RemoveConnection(id) method to Server for single-connection removal.

Fix deadlock in Stop(): previously held s.mu.Lock() while calling
c.Close() -> wg.Wait(), but the disconnect handler's RemoveConnection()
also acquires s.mu.Lock(). Fix: collect connections, clear map, release
lock, then close connections outside the lock.

Resolves issues #1 (conn memory leak), #2 (stale publishers), #3 (stale
subscribers), #4 (MediaLogger leak), #6 (unclosed recorders) from spec 005.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants