Skip to content

Commit

Permalink
add mutex lock in getQueryContextCacheSize
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-ext-simba-jl committed Oct 12, 2023
1 parent c2f3b53 commit b0ac257
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion htap.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,11 @@ func (qcc *queryContextCache) prune(size int) {
}

func (qcc *queryContextCache) getQueryContextCacheSize(sc *snowflakeConn) int {
if sizeStr, ok := sc.cfg.Params[queryContextCacheSizeParamName]; ok {
paramsMutex.Lock()
sizeStr, ok := sc.cfg.Params[queryContextCacheSizeParamName]
paramsMutex.Unlock()

if ok {
size, err := strconv.Atoi(*sizeStr)
if err != nil {
logger.Warnf("cannot parse %v as int as query context cache size: %v", sizeStr, err)
Expand Down

0 comments on commit b0ac257

Please sign in to comment.