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

Restart summarizer when it stops [0.10] #348

Merged
merged 1 commit into from
Oct 17, 2019

Conversation

arinwt
Copy link
Contributor

@arinwt arinwt commented Oct 15, 2019

Also prevent starting a new summarizer if one is already running and add a few telemetry details.

Fixes #107.

@arinwt arinwt requested a review from vladsud October 15, 2019 23:34
@arinwt arinwt changed the title Restart summarizer when it stops Restart summarizer when it stops [0.10] Oct 16, 2019
@vladsud
Copy link
Contributor

vladsud commented Oct 17, 2019

private computeSummarizer(force = false) {

I'd rename this argument. From code, it's more suitable to call it summarizerIsNotYetRunning, or something like that.


Refers to: packages/runtime/container-runtime/src/summaryManager.ts:110 in 4082d1d. [](commit_id = 4082d1d, deletion_comment = False)

},
(error) => {
this.logger.sendErrorEvent({ eventName: "RunningSummarizerFailed" }, error);
runSummarizerEvent.cancel({}, error);
this.computeSummarizer(this.connected);
Copy link
Contributor

Choose a reason for hiding this comment

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

Feels like this should be in finally case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree but I was trying to avoid floating promises and I wanted the compute summarizer call to occur after the telemetry event.

}

// if we are connected and the elected summarizer client, start a summarizer
if (this.shouldSummarize && !this.runningSummarizer) {
Copy link
Contributor

Choose a reason for hiding this comment

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

!this.runningSummarizer [](start = 35, length = 24)

It feels like this code asks either for assert(!this.runningSummarizer) or handling of when it's running - stopping it if !this.shouldSummarize

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think an assert works here, since we should have already been stopped above.

}

if (this.runningSummarizer) {
summarizer.stop("parentAlreadyRunningSummarizer");
Copy link
Contributor

Choose a reason for hiding this comment

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

summarizer.stop("parentAlreadyRunningSummarizer"); [](start = 12, length = 50)

Sounds like this is an error, i.e. it would be nice to have explicit error telemetry events here.

Copy link
Contributor

@vladsud vladsud left a comment

Choose a reason for hiding this comment

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

:shipit:

@arinwt
Copy link
Contributor Author

arinwt commented Oct 17, 2019

I want to spend more time on SummaryManager in a later PR, but I think we should still get this PR merged to reduce Summary Nacks.

@arinwt arinwt merged commit fb68356 into microsoft:release/0.10 Oct 17, 2019
@arinwt arinwt deleted the restart-summarizer branch October 17, 2019 08:54
@arinwt arinwt mentioned this pull request Oct 31, 2019
arinwt pushed a commit that referenced this pull request Oct 31, 2019
* Restart summarizer when it completes and do not run new summarizer if already running (#348)

* Container handle errors during reload context [0.10] (#369)

* Handle errors during reloadContext and await pause/resume calls

* Always emit errors and reject promise on error

* Change reloadContext to reject throw error on catch

* Refactor SummaryManager [0.10] (#362)

* Change SummaryManager to state machine

* Remove shouldNotStop telemetry event

* Clean up switch statement to prevent fallthrough

* Small changes for PR feedback

* Use finally for run completion

* Summarize more frequently [0.10] (#371)

* Quorum ops count towards summarizer heuristics; summarizer handle ops while summarizing or pending

* Ignore summarizer leave messages, just in case

* Refactor summarizer code

* Add telemetry and small refactors

* Add comments; small refactor of summary op handling; track seq instead of flag
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.

None yet

2 participants