Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: move timer outside loops #5880

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

exu
Copy link
Member

@exu exu commented Sep 30, 2024

Pull request description

Checklist (choose whats happened)

  • breaking change! (describe)
  • tested locally
  • tested on cluster
  • added new dependencies
  • updated the docs
  • added a test

Breaking changes

Changes

Fixes

@kubeshop-bot
Copy link
Collaborator

@@ -272,19 +273,31 @@ func (ag *Agent) sendResponse(ctx context.Context, stream cloud.TestKubeCloudAPI
}
}

func (ag *Agent) newTimeoutTimer() {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will it work between go routines?

var cmd *cloud.ExecuteRequest
select {
case resp := <-respChan:
if !t.Stop() {
<-t.C
if !ag.timeoutTimer.Stop() {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should it be synced ? it can panic in some use cases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants