apache / apache/pulsar-client-go

Error comment/behavior of default negative backoff policy

Open
#827 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
745
Forks
389
Avg merge
3d 20h
Merged PRs (30d)
3

Description

#### Expected behavior

int the `pulsar/negative_backoff_policy.go` file, the Next function declare two variables
```go
minNackTimeMs := int64(1000 * 30) and comment "30 sec"
maxNackTimeMs := 1000 * 60 * 10 and comment "10 min"
```
But the Next function which is called in `pulsar/consumer_partition.go` `reconnectToBroker`(or maybe other places),
and we can see that the return value of used in `time.Sleep()` which means its unit should be nanosecond(same as time.Duration).
So if we want a "30 sec" or "10 min", than we should declare below:
```go
minNackTimeMs := int64(30 * 1000 * 1000 * 1000) // 30sec
maxNackTimeMs := int64(10 * 60 * 1000 * 1000 * 1000) // 10min
```

#### Actual behavior

Tell us what happens instead

#### Steps to reproduce

How can we reproduce the issue

#### System configuration
**Pulsar version**: x.y

Contributor guide

Open the contributing guide

Research direction

Inspect pulsar/negative_backoff_policy.go and the Next function, then trace its callers in pulsar/consumer_partition.go, including reconnectToBroker. Verify the returned duration's unit before it reaches time.Sleep; done means the configured 30-second and 10-minute backoffs, comments, and observed behavior agree.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend, distributed-systems
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.