fix: fix error bitsize of jobservice reaper scan locks (#18487)

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>
This commit is contained in:
Chlins Zhang 2023-04-07 10:59:30 +08:00 committed by GitHub
parent 499940a8a7
commit 5791f0c979
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -245,7 +245,7 @@ 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")
}
@ -253,7 +253,7 @@ func (r *reaper) scanLocks(key string, handler func(k string, v int64) error) er
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)