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

Do Konnect and Gateway reconciliation in different goroutines #6188

Closed
2 of 3 tasks
lahabana opened this issue Jun 12, 2024 · 1 comment
Closed
2 of 3 tasks

Do Konnect and Gateway reconciliation in different goroutines #6188

lahabana opened this issue Jun 12, 2024 · 1 comment
Assignees
Labels
area/konnect Issues and PRs related to Konnect release/required it is required that this be resolved before releasing
Milestone

Comments

@lahabana
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Does this enhancement require public documentation?

  • I have added an Acceptance Criteria item for adding and/or adjusting public documentation (if applicable)

Problem Statement

When we update the config:

  1. we push config to all gateways in parallel, waiting for all to return
  2. then we push to Konnect.

See:

shas, gatewaysSyncErr := c.sendOutToGatewayClients(ctx, parsingResult.KongState, c.kongConfig, isFallback)
konnectSyncErr := c.maybeSendOutToKonnectClient(ctx, parsingResult.KongState, c.kongConfig, isFallback)

This happens in a loop that IIUC is run every 3s:

for {
select {
case <-ctx.Done():
p.logger.Info("Context done: shutting down the proxy update server")
if err := ctx.Err(); err != nil && !errors.Is(err, context.Canceled) {
p.logger.Error(err, "Context completed with error")
}
p.syncTicker.Stop()
p.lock.Lock()
defer p.lock.Unlock()
p.isServerRunning = false
p.configApplied = false
return
case <-p.syncTicker.C:
if err := p.dataplaneClient.Update(ctx); err != nil {
p.logger.Error(err, "Could not update kong admin")
continue
}
initialConfig.Do(p.markConfigApplied)
}
}
}

So if Konnect sync takes too long, this may negatively impact dataplanes as they may not receive up to date configs.

Proposed Solution

  • Run Konnect sync in a separate goroutine to avoid slowing down reconciliation if Konnect sync is taking too long
  • Ensure that Konnect sync can skip ticks if things take too long

Additional information

No response

Acceptance Criteria

  • Konnect sync that takes over 3s won't block dataplane reconciliation
@lahabana lahabana added the area/konnect Issues and PRs related to Konnect label Jun 12, 2024
@lahabana lahabana added this to the KIC v3.3.x milestone Jun 12, 2024
@lahabana lahabana added the release/required it is required that this be resolved before releasing label Jun 24, 2024
@randmonkey randmonkey self-assigned this Jul 12, 2024
@lahabana
Copy link
Contributor Author

Replaced by #6325

@lahabana lahabana closed this as not planned Won't fix, can't repro, duplicate, stale Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/konnect Issues and PRs related to Konnect release/required it is required that this be resolved before releasing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants