TykTechnologies / tyk

Tyk Open Source API Gateway written in Go, supporting REST, GraphQL, TCP and gRPC protocols
Other
9.75k stars 1.09k forks source link

Merging to release-5-lts: TT-13130 only mark the wg as done when the connection is stablished (#6574) #6575

Closed buger closed 2 months ago

buger commented 2 months ago

TT-13130 only mark the wg as done when the connection is stablished (#6574)

User description

Description

When the gw is ran as edge we want this to wait until the connection is established with MDCB before attempting to pull policies and apis, we should only mark the connection waitgroup as done when the connection is successful not on every attempt

Related Issue

TT-13130

Motivation and Context

How This Has Been Tested

Screenshots (if appropriate)

Types of changes

Checklist


PR Type

Bug fix


Description


Changes walkthrough 📝

Relevant files
Bug fix
rpc_client.go
Fix waitgroup completion logic in connection establishment

rpc/rpc_client.go
  • Removed the Done() call from the defer statement in the Dial function.
  • Added Done() call after the connection is successfully established.
  • Ensures the waitgroup is marked as done only upon successful
    connection.
  • +2/-1     

    💡 PR-Agent usage: Comment /help "your question" on any pull request to receive relevant information

    Co-authored-by: sredny buitrago sredny@srednys-MacBook-Pro.local

    github-actions[bot] commented 2 months ago

    API Changes

    no api changes detected
    sonarcloud[bot] commented 2 months ago

    Quality Gate Failed Quality Gate failed

    Failed conditions
    56.5% Coverage on New Code (required ≥ 80%)

    See analysis details on SonarCloud