Skip to content

Commit fe77758

Browse files
committed
Add changelog entries for recent contributions + a couple minor tweaks
Adds changelog entries for #1147, #1148, and #1149. Also make a couple small tweaks: one to alphabetize a newly added property, and one to move a success case test to above the error case, which is a little more conventional.
1 parent 422df4c commit fe77758

4 files changed

Lines changed: 23 additions & 17 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
- Added root River CLI flag `--statement-timeout` so Postgres session statement timeout can be set explicitly for commands like migrations. Explicit flag values take priority over database URL query params, and query params still take priority over built-in defaults. [PR #1142](https://github.com/riverqueue/river/pull/1142).
1313

14+
### Fixed
15+
16+
- Fix connection leak in `Listener.Connect` in case where `afterConnectExec` failed. [PR #1147](https://github.com/riverqueue/river/pull/1147).
17+
- Fix missing `ticker.Stop` in producer's `pollForSettingChanges`. [PR #1148](https://github.com/riverqueue/river/pull/1148).
18+
- Fix accidental use of cancelled context for `Notifier.Ping`. [PR #1149](https://github.com/riverqueue/river/pull/1149).
19+
1420
### Changed
1521

1622
- Upgrade supported Go versions to 1.25 and 1.26, and update CI accordingly. [PR #1144](https://github.com/riverqueue/river/pull/1144).

internal/notifier/notifier.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ type Notifier struct {
7979
baseservice.BaseService
8080
startstop.BaseStartStop
8181

82-
disableSleep bool // for tests only; disable sleep on exponential backoff
83-
testPingInterval time.Duration // for tests only; override the 5s ping interval
8482
listener riverdriver.Listener
8583
notificationBuf chan *riverdriver.Notification
84+
testDisableSleep bool // for tests only; disable sleep on exponential backoff
85+
testPingInterval time.Duration // for tests only; override the 5s ping interval
8686
testSignals notifierTestSignals
8787
waitInterruptChan chan func()
8888

@@ -152,7 +152,7 @@ func (n *Notifier) Start(ctx context.Context) error {
152152
slog.String("sleep_duration", sleepDuration.String()),
153153
)
154154
n.testSignals.BackoffError.Signal(err)
155-
if !n.disableSleep {
155+
if !n.testDisableSleep {
156156
serviceutil.CancellableSleep(ctx, sleepDuration)
157157
}
158158
}

internal/notifier/notifier_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ func TestNotifier(t *testing.T) {
490490

491491
notifier, _ := setup(t, nil)
492492

493-
notifier.disableSleep = true
493+
notifier.testDisableSleep = true
494494

495495
var errorNum int
496496

@@ -582,7 +582,7 @@ func TestNotifier(t *testing.T) {
582582
notifier, bundle := setup(t, nil)
583583

584584
// Disable the backoff sleep that would occur after the first retry.
585-
notifier.disableSleep = true
585+
notifier.testDisableSleep = true
586586

587587
var errorNum int
588588

riverdriver/riverpgxv5/river_pgx_v5_driver_test.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,18 @@ func TestListener_Connect(t *testing.T) {
9494

9595
ctx := context.Background()
9696

97+
t.Run("SuccessfulConnect", func(t *testing.T) {
98+
t.Parallel()
99+
100+
pool := testPool(ctx, t, nil)
101+
listener := &Listener{dbPool: pool}
102+
103+
require.NoError(t, listener.Connect(ctx))
104+
require.NotNil(t, listener.conn)
105+
106+
require.NoError(t, listener.Close(ctx))
107+
})
108+
97109
t.Run("ReleasesPoolConnOnAfterConnectExecError", func(t *testing.T) {
98110
t.Parallel()
99111

@@ -118,18 +130,6 @@ func TestListener_Connect(t *testing.T) {
118130
require.NoError(t, err, "pool connection was leaked: Acquire timed out because the connection was not released")
119131
conn.Release()
120132
})
121-
122-
t.Run("SuccessfulConnect", func(t *testing.T) {
123-
t.Parallel()
124-
125-
pool := testPool(ctx, t, nil)
126-
listener := &Listener{dbPool: pool}
127-
128-
require.NoError(t, listener.Connect(ctx))
129-
require.NotNil(t, listener.conn)
130-
131-
require.NoError(t, listener.Close(ctx))
132-
})
133133
}
134134

135135
func TestInterpretError(t *testing.T) {

0 commit comments

Comments
 (0)