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

The config importer [will minimize the issue] #79

Merged
merged 7 commits into from
Jun 29, 2022
Merged

Conversation

nour-borgi
Copy link
Collaborator

It turns out that the elasticsearch service will join the network after some time.
An error ENOTFOUND will occur if the config importer send the config before elasticsearch join the network.
So, we added a loop that will wait for elasticsearch to join the network.
With this fix, the config importer issue will not occur again.

But, with this fix the code will exit with error and the config importer will not be executed.

This issue still rarely exists with elasticsearch and other services as well.

Copy link
Contributor

@Mark-Labuschagne Mark-Labuschagne left a comment

Choose a reason for hiding this comment

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

Looks good, just a few minor comments 😁

analytics-datastore-elastic-search/swarm.sh Outdated Show resolved Hide resolved
analytics-datastore-elastic-search/swarm.sh Outdated Show resolved Hide resolved
@@ -42,6 +42,22 @@ configure_nginx() {
fi
}

AwaitServiceTojoinNetwork() {
Copy link
Contributor

Choose a reason for hiding this comment

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

If we're going to implement this function in a few places, it's probably worth writing this into a utility function and inserting that in config-utils.sh.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yea yea you're right 👍

Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove this function, it's no longer referenced

dashboard-visualiser-kibana/swarm.sh Outdated Show resolved Hide resolved
Copy link
Contributor

@Mark-Labuschagne Mark-Labuschagne left a comment

Choose a reason for hiding this comment

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

Looks good, just two minor comments

@@ -42,6 +42,22 @@ configure_nginx() {
fi
}

AwaitServiceTojoinNetwork() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove this function, it's no longer referenced

local start_time=$(date +%s)
local exit_time=30
local warning_time=10
local timer=0
Copy link
Contributor

Choose a reason for hiding this comment

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

Unreferenced variable

Suggested change
local timer=0

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Nice catch man

config::await_network_join() {
echo "Waiting for elasticsearch service to join network..."

local -r SERVICE_NAME="${1:?"FATAL: await_service_removed SERVICE_NAME not provided"}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice one!

Copy link
Contributor

@Mark-Labuschagne Mark-Labuschagne left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@rcrichton rcrichton left a comment

Choose a reason for hiding this comment

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

Looks good just one comment.

utils/config-utils.sh Outdated Show resolved Hide resolved
@rcrichton rcrichton merged commit 3d41fd6 into main Jun 29, 2022
@rcrichton rcrichton deleted the jsreport-ports-update branch June 29, 2022 12:20
@rcrichton rcrichton restored the jsreport-ports-update branch June 29, 2022 14:59
@nour-borgi nour-borgi deleted the jsreport-ports-update branch July 1, 2022 08:51
@nour-borgi nour-borgi restored the jsreport-ports-update branch July 1, 2022 08:51
@nour-borgi nour-borgi deleted the jsreport-ports-update branch July 1, 2022 08:52
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.

3 participants