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

Block server start until origins file is loaded. #643

Merged
merged 5 commits into from
Mar 11, 2020

Conversation

mikkokar
Copy link
Contributor

@mikkokar mikkokar commented Mar 9, 2020

Problem Description:

YamlFileConfigurationService doesn't prevent Styx HTTP server from starting if it doesn't successfully load an initial origins configuration file.

Therefore, Styx server starts without sensible origins configuration. All requests to its HTTP port will return 404 NOT FOUND, with message Not found: pathPrefixRouter in response body.

This affects only the new YamlFileConfigurationService. The old monolithic application router is unaffected.

Root Cause & The Fix

Problem was caused by ServiceProviderMonitor which loads all service providers from Yaml providers block. It didn't wait for the underlying service providers to be started correctly.

I fixed this by modifying the ServiceProviderMonitor class so that it waits for all underlying services to successfully start up before declaring itself as healthy to phase1 service manager.

@mikkokar mikkokar changed the title Prevent styx from starting until service providers are all started. Block HTTP server start until service providers are all started. Mar 10, 2020
@mikkokar mikkokar changed the title Block HTTP server start until service providers are all started. Block server start until service providers are all started. Mar 10, 2020
@mikkokar mikkokar changed the title Block server start until service providers are all started. Block server start until origins file is loaded. Mar 10, 2020
@mikkokar mikkokar marked this pull request as ready for review March 10, 2020 11:41
@mikkokar mikkokar merged commit 059bb28 into ExpediaGroup:master Mar 11, 2020
@mikkokar mikkokar deleted the fix-service-provider-start branch March 11, 2020 16:10
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.

2 participants