Skip to content

Commit

Permalink
[NVSHAS-9681] Scanner Registration Timeout Issue: Increased database …
Browse files Browse the repository at this point in the history
…slots from 256 to 512.

- The previous size of 128 was insufficient, causing timeouts during scanner registration with the controller.
  • Loading branch information
pohanhuangtw committed Dec 12, 2024
1 parent 06eefb0 commit 4416b08
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion controller/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ import (

// const scanImageDataTimeout = time.Second * 45
const repoScanTimeout = time.Minute * 20
const (
dbSlotsBase = 256
dbSlotsMax = 512
)

type ScanService struct {
}
Expand Down Expand Up @@ -66,7 +70,7 @@ func (ss *ScanService) preprocessDB(data *share.ScannerRegisterData) map[string]

func (ss *ScanService) prepareDBSlots(data *share.ScannerRegisterData, cvedb map[string]*share.ScanVulnerability) ([][]byte, error) {
// As of now, Feb. 2019, the compressed db size is 3M, while max kv value size is 512K.
for slots := 128; slots <= 256; slots *= 2 {
for slots := dbSlotsBase; slots <= dbSlotsMax; slots *= 2 {
log.WithFields(log.Fields{"slots": slots}).Debug()

enlarge := false
Expand Down

0 comments on commit 4416b08

Please sign in to comment.