Skip to content

Commit 3ffa4de

Browse files
kvapsclaude
andcommitted
style: clean up lint debt across Phase 8 commits
Three wsl_v5 (no shared variables above defer) and one revive (time-naming "Min" suffix on a time.Duration var) — all introduced across the recent Phase 8.1-8.2 work. Resolved without changing behaviour: blank lines before defer, rename observeRetryMin → observeRetryInitial. `make lint` now reports 0 issues. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
1 parent 9d285ae commit 3ffa4de

3 files changed

Lines changed: 9 additions & 5 deletions

File tree

pkg/dispatcher/dispatcher.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ func (d *Dispatcher) Apply(ctx context.Context, target *blockstoriov1alpha1.Reso
116116
if err != nil {
117117
return nil, errors.Wrapf(err, "dial %s", endpoint)
118118
}
119+
119120
defer func() { _ = closer() }()
120121

121122
resp, err := client.ApplyResources(ctx, &satellitepb.ApplyResourcesRequest{
@@ -409,6 +410,7 @@ func (d *Dispatcher) DeleteResource(ctx context.Context, target *blockstoriov1al
409410
if err != nil {
410411
return nil, errors.Wrapf(err, "dial %s", endpoint)
411412
}
413+
412414
defer func() { _ = closer() }()
413415

414416
pool := target.Spec.Props["StorPoolName"]

pkg/satellite/agent.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ func (a *Agent) Run(ctx context.Context) error {
117117
if err != nil {
118118
return errors.Wrap(err, "dial controller")
119119
}
120+
120121
defer func() { _ = conn.Close() }()
121122

122123
client := satellitepb.NewControllerClient(conn)
@@ -231,7 +232,7 @@ func (a *Agent) dial(ctx context.Context) (*grpc.ClientConn, error) {
231232
// would never learn we exist again and ApplyResources / DeleteResource
232233
// RPCs would all fail with "no SatelliteEndpoint for node X".
233234
func (a *Agent) superviseObserveLoop(ctx context.Context, client satellitepb.ControllerClient) {
234-
backoff := observeRetryMin
235+
backoff := observeRetryInitial
235236

236237
for {
237238
select {
@@ -244,7 +245,7 @@ func (a *Agent) superviseObserveLoop(ctx context.Context, client satellitepb.Con
244245
if err == nil {
245246
a.runObserveLoop(ctx, client)
246247

247-
backoff = observeRetryMin
248+
backoff = observeRetryInitial
248249
} else {
249250
a.logger.Error("re-hello", "err", err)
250251
}
@@ -377,13 +378,13 @@ func (a *Agent) runCapacityLoop(ctx context.Context, client satellitepb.Controll
377378
// in /v1/view/storage-pools' free_capacity within ~half a minute.
378379
const capacityInterval = 30 * time.Second
379380

380-
// observeRetryMin / observeRetryMax bound the reconnect backoff in
381+
// observeRetryInitial / observeRetryMax bound the reconnect backoff in
381382
// superviseObserveLoop. We want fast pickup after a controller restart
382383
// (300 ms) but no thundering-herd if the controller stays down (cap
383384
// at 30 s, doubling each failure).
384385
const (
385-
observeRetryMin = 300 * time.Millisecond
386-
observeRetryMax = 30 * time.Second
386+
observeRetryInitial = 300 * time.Millisecond
387+
observeRetryMax = 30 * time.Second
387388
)
388389

389390
// observeBuffer caps the events2 → Observer in-flight queue. drbd-9

tests/contract/replay.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ func replayOne(ctx context.Context, client *http.Client, baseURL string, trace *
8787
if err != nil {
8888
return Result{}, errors.Wrap(err, "send request")
8989
}
90+
9091
defer func() { _ = resp.Body.Close() }()
9192

9293
respBody, err := io.ReadAll(resp.Body)

0 commit comments

Comments
 (0)