Skip to content

shardservice: Close leaves RPC listener accepting connections #29709

Closed

Description

@XuPeng-SH

Problem

pkg/shardservice.service.Close stops background work and closes the RPC client, but does not close the RPC server created by initRemote. After Close returns, the Unix listener still accepts connections and its accept goroutine remains alive.

Observed in PR #29694's coverage job: https://github.com/matrixorigin/matrixone/actions/runs/37761393016/job/113259178297?pr=29694 . TestRead reports two leaked goetty goroutines blocked in UnixListener.Accept.

Reproduction and expected behavior

Against revision 82322ceced2c5cc8207953ab0111f40e4424ceef, create a real shard service, call Close, then dial its Unix socket. The dial succeeds; an external regression probe fails with closed shard service still accepts connections.

Close should release both owned RPC endpoints, reject new connections, and preserve shutdown errors while attempting all cleanup.

The shared test fixture also immediately invokes leaktest.AfterTest(t)() at entry and cleans up only after the scenario returns normally. Its resources and leak detection must unwind correctly after assertion failure or panic.

Fix and evidence

PR #29708 restores RPC server teardown and independent deferred fixture cleanup. Owning-package normal, race, and coverage-mode checks pass; negative controls detect the original leak, and real fixture probes verify failure-path cleanup.

Activity

  1. added a commit that references this issue on Oct 8, 2026
    ca5008d
  2. self-assigned this
    on Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions