sassoftware / sassoftware/arke

streamSubscribe panics on NewConsumer failure; unsynced stats counters

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

Nobody has claimed this yet.

bug go
Dominant language
Go
Stars
6
Forks
2
Avg merge
2d 2h
Merged PRs (30d)
8

Description

Two bugs in the amqp091 stream path:

  • streamSubscribe ignores the error from StreamConnection.NewConsumer and then unconditionally calls consumer.Close(). When the consumer fails to construct it returns (nil, err), and the subsequent Close() panics the goroutine. The error should be surfaced as *pb.Error and the increment/Close path skipped.
  • Stats() and connectionCleaner read produced, consumed, and ActiveStreams as plain int64s, but writers use atomic.AddInt64. The reads should use atomic.LoadInt64 to remove the data race.

Contributor guide

Open the contributing guide

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.

Research direction

Start at the streamSubscribe, Stats(), and connectionCleaner entry points. Trace the NewConsumer failure path and the atomic writes to produced, consumed, and ActiveStreams; done means the failure returns a *pb.Error without panicking and the counter reads are race-safe.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.