This is an automated email from the ASF dual-hosted git repository.
liuhan pushed a commit to branch reduce-handle-connect-time
in repository https://gitbox.apache.org/repos/asf/skywalking-rover.git
The following commit(s) were added to refs/heads/reduce-handle-connect-time by
this push:
new 5b395c5 update mutex
5b395c5 is described below
commit 5b395c5a8351c0ae29a0bd7fef04f0dad09d7303
Author: mrproliu <[email protected]>
AuthorDate: Sun Dec 29 00:31:58 2024 +0800
update mutex
---
pkg/process/finders/kubernetes/finder.go | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/pkg/process/finders/kubernetes/finder.go
b/pkg/process/finders/kubernetes/finder.go
index 0444c82..8396590 100644
--- a/pkg/process/finders/kubernetes/finder.go
+++ b/pkg/process/finders/kubernetes/finder.go
@@ -431,7 +431,6 @@ func (f *ProcessFinder) IsPodIP(ip string) (bool, error) {
mutex := f.podIPMutexes[sum32%ipSearchParallel]
mutex.Lock()
defer mutex.Unlock()
- log.Infof("searching pod ip: %s", ip)
pods, err := f.CLI.CoreV1().Pods(v1.NamespaceAll).List(f.ctx,
metav1.ListOptions{
FieldSelector: fields.OneTermEqualSelector("status.podIP",
ip).String(),
@@ -443,8 +442,7 @@ func (f *ProcessFinder) IsPodIP(ip string) (bool, error) {
found := len(pods.Items) > 0
// the timeout added a random value to avoid the cache avalanche
- addedTime := time.Millisecond * time.Duration(rand.IntnRange(1000,
10000))
+ addedTime := time.Second * time.Duration(rand.IntnRange(10, 60))
f.podIPChecker.Set(ip, found, ipExistTimeout+addedTime)
- log.Infof("found pod ip: %s, %v", ip, found)
return found, nil
}