Skip to content

Conversation

zeoxisca
Copy link
Contributor

@zeoxisca zeoxisca commented Sep 29, 2024

Close pool in Cleanup to prevent Get getting stuck in concurrent scenarios.

Like case below

func foobar1(ctx context.Context) {
  go func() {
      ...
      page, err := pagePool.Get( )                    // may stuck in Get
      ...
  }()
  
  select {
     case ctx.Done:    
            pagePool.Cleanup(func(){  xxxxxx   })
            browser.Close()     // browser closed and pagePool closed 
  }
}

Development guide

Link

Test on local before making the PR

go run ./lib/utils/simple-check

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.

1 participant