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: add --db-workspace-update-propagation-delay CLI flag #789

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

Conversation

GGabriele
Copy link
Collaborator

@GGabriele GGabriele commented Nov 8, 2022

When some configuration is applied to a non-existent workspace, decK creates the workspace before proceeding with the other queries. In such cases, it may happen that Kong is not "fast" enough to propagate workspace changes, leading to some misleading 404s due to not-existing (not-propagated) workspaces.

This commit is adding a new --db-workspace-update-propagation-delay CLI flag to introduce an artificial delay when a new workspace is created.
This is different from the --db-update-propagation-delay flag, as the latter gets applied to every insert operation and it was initially introduced to address some Cassandra limitation.

Related to #783

When some configuration is applied to a non-existent workspace,
decK creates the workspace before proceeding with the other
queries. In such cases, it may happen that Kong is not "fast"
enough to propagate workspace changes, leading to some misleading
404s due to not-existing (not-propagated) workspaces.

This commit is adding a new --db-workspace-update-propagation-delay
CLI flag to introduce an artificial delay when a new workspace
is created.
This is different from the --db-update-propagation-delay flag, as
the latter gets applied to every insert operation and it was
initially introduced to address some Cassandra limitation.
@GGabriele GGabriele temporarily deployed to Configure ci November 8, 2022 12:36 Inactive
@@ -206,6 +207,8 @@ func syncMain(ctx context.Context, filenames []string, dry bool, parallelism,
if err != nil {
return err
}
// make sure the DB is updated and ready to receive new workspace queries.
time.Sleep(time.Duration(syncCmdDBWSUpdateDelay) * time.Second)
Copy link
Contributor

Choose a reason for hiding this comment

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

there is no workspace endpoint we could query in a waiting mode for this issue?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

very good point! We can probably wait for a 200 on /workspaces/<ws> or something like that

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.

None yet

2 participants