Skip to content

Commit 4609fe0

Browse files
authored
Fix the program cannot be closed when KinD environment has exported multiple ports (#61)
1 parent 7f03637 commit 4609fe0

3 files changed

Lines changed: 4 additions & 2 deletions

File tree

docs/en/setup/Configuration-File.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ After the `Setup` step is finished, use the `Trigger` step to generate traffic.
131131
trigger:
132132
action: http # The action of the trigger. support HTTP invoke.
133133
interval: 3s # Trigger the action every 3 seconds.
134-
times: 5 # How many times to trigger the action, 0=infinite.
134+
times: 5 # The retry count before the request success.
135135
url: http://apache.skywalking.com/ # Http trigger url link.
136136
method: GET # Http trigger method.
137137
headers:

internal/components/setup/kind.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ func KindShouldWaitSignal() bool {
140140
// KindCleanNotify notify when clean up
141141
func KindCleanNotify() {
142142
if portForwardContext != nil {
143-
portForwardContext.stopChannel <- struct{}{}
143+
close(portForwardContext.stopChannel)
144144
// wait all stopped
145145
for i := 0; i < portForwardContext.resourceCount; i++ {
146146
<-portForwardContext.resourceFinishedChannel

internal/components/trigger/http.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package trigger
1919

2020
import (
2121
"fmt"
22+
"io"
2223
"net/http"
2324
"os"
2425
"strings"
@@ -124,6 +125,7 @@ func (h *httpAction) execute() error {
124125
logger.Log.Errorf("do request error %v", err)
125126
return err
126127
}
128+
_, _ = io.ReadAll(response.Body)
127129
_ = response.Body.Close()
128130

129131
logger.Log.Debugf("do request %v response http code %v", h.url, response.StatusCode)

0 commit comments

Comments
 (0)