Skip to content

Commit

Permalink
fix: fix error bitsize of jobservice reaper scan locks (#18487)
Browse files Browse the repository at this point in the history
Change the bitSize from 16 to 64 in the jobservice reaper, the 16 is too
small when the redis cursor over the max value of int16.

Fixes: #18486

Signed-off-by: chlins <chenyuzh@vmware.com>
  • Loading branch information
chlins authored Apr 7, 2023
1 parent 499940a commit 5791f0c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/jobservice/worker/cworker/reaper.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,15 +245,15 @@ func (r *reaper) scanLocks(key string, handler func(k string, v int64) error) er
}

// Get next cursor
cursor, err = strconv.ParseInt(string(reply[0].([]uint8)), 10, 16)
cursor, err = strconv.ParseInt(string(reply[0].([]uint8)), 10, 64)
if err != nil {
return errors.Wrap(err, "scan locks")
}

if values, ok := reply[1].([]interface{}); ok {
for i := 0; i < len(values); i += 2 {
k := string(values[i].([]uint8))
lc, err := strconv.ParseInt(string(values[i+1].([]uint8)), 10, 16)
lc, err := strconv.ParseInt(string(values[i+1].([]uint8)), 10, 64)
if err != nil {
// Ignore and continue
logger.Errorf("Malformed lock object for %s: %v", k, err)
Expand Down

0 comments on commit 5791f0c

Please sign in to comment.