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

BCF-2657: core/services: track spawned job services via the health checker #10695

Merged
merged 2 commits into from
Sep 20, 2023

Conversation

jmank88
Copy link
Contributor

@jmank88 jmank88 commented Sep 18, 2023

I noticed that we only add services to the health checker during initial application startup, which leaves out services spawned by jobs.

https://smartcontract-it.atlassian.net/browse/BCF-2657

@github-actions
Copy link
Contributor

I see that you haven't updated any README files. Would it make sense to do so?

@@ -52,6 +53,18 @@ type connectionManager struct {
lggr logger.Logger
}

func (m *connectionManager) HealthReport() map[string]error {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add coverage to the new API surface?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe. I'd rather not repeat something trivial at a low level all over though.

It would be nice to have a high level test that spins up many things and provides a view of all the different kinds of services from one place.
There is a /health endpoint that we can test against.

Another approach is to eliminate the need to write this method every time. I just revived an old service helper branch that might help with this, by providing an extension of utils.StartStopOnce that incorporates this, among other things.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, makes sense. I like that approach

@@ -59,6 +61,16 @@ type gatewayConnector struct {
lggr logger.Logger
}

func (c *gatewayConnector) HealthReport() map[string]error {
Copy link
Contributor

Choose a reason for hiding this comment

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

Same thought as above - wondering if we can directly test this surface area

@jmank88 jmank88 force-pushed the dynamic-health-checker branch from d8fc2e2 to c3da5a9 Compare September 19, 2023 00:07
@jmank88 jmank88 requested review from a team and samsondav as code owners September 19, 2023 00:07
@jmank88 jmank88 force-pushed the dynamic-health-checker branch from c3da5a9 to e0cd817 Compare September 19, 2023 02:07
@jmank88 jmank88 force-pushed the dynamic-health-checker branch from e0cd817 to b2d05d5 Compare September 19, 2023 02:08
@jmank88 jmank88 changed the title core/services: track spawned job services via the health checker BCF-2657: core/services: track spawned job services via the health checker Sep 19, 2023
@cl-sonarqube-production
Copy link

SonarQube Quality Gate

Quality Gate failed

Failed condition 62.3% 62.3% Coverage on New Code (is less than 80%)

See analysis details on SonarQube

@jmank88 jmank88 requested review from a team and patrickhuie19 September 19, 2023 14:11
@jmank88 jmank88 added this pull request to the merge queue Sep 20, 2023
Merged via the queue into develop with commit 8139563 Sep 20, 2023
@jmank88 jmank88 deleted the dynamic-health-checker branch September 20, 2023 13:51
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