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

Sleep after namespace registration to refresh cache #101

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions docker/auto-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -288,15 +288,12 @@ register_default_namespace() {
else
echo "Default namespace ${DEFAULT_NAMESPACE} already registered."
fi

echo "Waiting for namespace cache to refresh (sleeping for 10 seconds)..."
sleep 10
Comment on lines +292 to +293

Choose a reason for hiding this comment

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

@pdoerner This seems related to the work you were doing for sync namespace registration. Any way we can get around using a sleep here?

Copy link
Member

Choose a reason for hiding this comment

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

Namespace cache should already support read through if namespace is not found.
I think the problem is there's no read through if search attribute within the namespace config is not found. Then this sleep should happen after search attributes are added?

An easy fix would be allow specifying search attributes when registering namespace.

}

add_custom_search_attributes() {
until temporal operator search-attribute list --namespace "${DEFAULT_NAMESPACE}"; do
echo "Waiting for namespace cache to refresh..."
sleep 1
done
echo "Namespace cache refreshed."

echo "Adding Custom*Field search attributes."
# TODO: Remove CustomStringField
# @@@SNIPSTART add-custom-search-attributes-for-testing-command
Expand Down