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

Add gateway to app server component checking #405

Open
wants to merge 15 commits into
base: v2.x/staging
Choose a base branch
from

Conversation

timgerstel
Copy link
Contributor

Proposed changes

This PR addresses Issue: [Link to Github issue within https://github.com/zowe/zlux/issues if any]

This PR depends upon the following PRs:

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Change in a documentation
  • Refactor the code
  • Chore, repository cleanup, updates the dependencies.
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

PR Checklist

Please delete options that are not relevant.

  • If the changes in this PR are meant for the next release / mainline, this PR targets the "staging" branch.
  • My code follows the style guidelines of this project (see: Contributing guideline)
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • New and existing unit tests pass locally with my changes
  • video or image is included if visual changes are made
  • Relevant update to CHANGELOG.md
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works, or describe a test method below

Testing

Further comments

Signed-off-by: Timothy Gerstel <tgerstel@rocketsoftware.com>
@timgerstel timgerstel changed the base branch from v1.x/staging to v2.x/staging April 5, 2022 06:24
Signed-off-by: Timothy Gerstel <tgerstel@rocketsoftware.com>
if(config.node.mediationLayer &&
config.node.mediationLayer.enabled &&
config.node.mediationLayer.server){
requestOptions.host = config.node.mediationLayer.server.hostname
Copy link
Member

Choose a reason for hiding this comment

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

}
return new Promise((resolve, reject) => {
httpApi.get(requestOptions, (res) => {
const { statusCode } = res; // TODO: Check status code for bad status
Copy link
Member

Choose a reason for hiding this comment

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

considering the gateway often starts slower than app-server, i think you need some sort of loop w/ timeout here because it's highly likely to fail on the first request.

Timothy Gerstel added 4 commits April 6, 2022 09:28
Signed-off-by: Timothy Gerstel <tgerstel@rocketsoftware.com>
Signed-off-by: Timothy Gerstel <tgerstel@rocketsoftware.com>
Signed-off-by: Timothy Gerstel <tgerstel@rocketsoftware.com>
@@ -959,12 +971,66 @@ PluginLoader.prototype = {
bootstrapLogger.severe(e.message);
resolve(); // We don't want to reject here. Error gets caught down stream
});
})
}).then(() => { /* Obtains and stores the endpoints exposed by the agent */
Copy link
Member

Choose a reason for hiding this comment

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

Think this comment was meant to be on line 945, line 975 can say the same thing except for API ML

Timothy Gerstel added 2 commits April 6, 2022 21:21
Signed-off-by: Timothy Gerstel <tgerstel@rocketsoftware.com>
Signed-off-by: Timothy Gerstel <tgerstel@rocketsoftware.com>
Copy link
Member

@DivergentEuropeans DivergentEuropeans left a comment

Choose a reason for hiding this comment

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

Changes have been addressed and this now seems to do what it was supposed to do 👍
I haven't tested it yet, but functionally looks good

This was referenced Apr 12, 2022
Timothy Gerstel added 2 commits April 12, 2022 11:14
Signed-off-by: Timothy Gerstel <tgerstel@rocketsoftware.com>

const gatewayCheck = () => {
if (Date.now() > end) {
log.warn(`ZWED0045`, this.apimlHost, this.apimlPort);
Copy link
Member

Choose a reason for hiding this comment

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

2022-04-12 20:34:27.699 <:> me WARN (_zsf.bootstrap,process.js:29) ZWED0036W - Uncaught exception found. Error:
ReferenceError: log is not defined
ZWED0037W - Ending server process due to uncaught exception.
ZWED0050I - Server shutting down, received signal=SIGQUIT

Timothy Gerstel added 4 commits April 13, 2022 09:47
Signed-off-by: Timothy Gerstel <tgerstel@rocketsoftware.com>
…ficient timeout length to connect to the mediation layer

Signed-off-by: Timothy Gerstel <tgerstel@rocketsoftware.com>
Signed-off-by: Timothy Gerstel <tgerstel@rocketsoftware.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Ready for Review
Development

Successfully merging this pull request may close these issues.

3 participants