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

Avoid NullReferenceException in case of job continuation #819

Merged
merged 1 commit into from
Oct 23, 2020

Conversation

koepalex
Copy link
Contributor

Issue: there are multiple places were the JobProcessor is set to null. Which can lead to NullReferenceException in Cancel method e.g. when job continuation is triggered.

Solution: Check for null in Cancel method and update worker status on every place were it set to null to have the information in cosmosdb in sync.

@koepalex koepalex requested a review from a team as a code owner October 22, 2020 16:09
@koepalex koepalex self-assigned this Oct 22, 2020
@koepalex koepalex merged commit c9d842d into master Oct 23, 2020
@koepalex koepalex deleted the koepalex/bug-job-continuation branch October 23, 2020 14:23
@@ -235,6 +237,8 @@ public class Worker : IWorker, IDisposable {

// Check if the job is to be continued with new configuration settings
if (_jobProcess.JobContinuation == null) {
_jobProcess.Status = WorkerStatus.Stopped;
Copy link
Member

Choose a reason for hiding this comment

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

also check for null here?

monikavar added a commit that referenced this pull request May 7, 2021
marcschier added a commit that referenced this pull request May 12, 2021
* Avoid NullReferenceException in case of job continuation (#819)
* WorkerSupervisor enable the reduction of Worker  (#751)

Worker supervisor should also stop worker if max number of worker has decreased
* Removed not used methods from IWorkerSupervisor interface
* Added observability property, to read number of workers from test
* Added tests for WorkerSupervisor
* [Refactoring] change accessibility to private for methods CreateWorker and StopWorker
* Extend WorkerSupervisor tests and logging when redusing MaxWorker
* Set WorkerSupervisor interval via optional parameter to optimize testing

Co-authored-by: Alexander Köpke <koepalex@xdigital.de>
Co-authored-by: Marc Schier <marcschier@users.noreply.github.com>
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

3 participants