Skip to content

Conversation

@Andyz26
Copy link
Collaborator

@Andyz26 Andyz26 commented Dec 18, 2024

Context

A race condition was introduced from #731 when a heartbeat check happened between launch event and first heartbeat and can trigger NPE on the actor.
Refactored the condition check on the case above + improve UTs to cover the related states.

Checklist

  • ./gradlew build compiles code correctly
  • Added new tests where applicable
  • ./gradlew test passes all tests
  • Extended README or added javadocs where applicable

@github-actions
Copy link

github-actions bot commented Dec 18, 2024

Test Results

619 tests  +1   609 ✅ +1   7m 44s ⏱️ +2s
142 suites ±0    10 💤 ±0 
142 files   ±0     0 ❌ ±0 

Results for commit 547a26d. ± Comparison against base commit e90032d.

This pull request removes 1 and adds 2 tests. Note that renamed tests count towards both.
io.mantisrx.master.jobcluster.job.JobTestLifecycle ‑ testHeartBeatMissingResubmit
io.mantisrx.master.jobcluster.job.JobTestLifecycle ‑ testHeartBeatPendingSchedulingNoResubmit
io.mantisrx.master.jobcluster.job.JobTestLifecycle ‑ testNoHeartBeatAfterLaunchResubmit

♻️ This comment has been updated with latest results.

Copy link
Contributor

@sundargates sundargates left a comment

Choose a reason for hiding this comment

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

lgtm

if (!workerMeta.getLastHeartbeatAt().isPresent() || Duration.between(workerMeta.getLastHeartbeatAt().get(), currentTime).getSeconds()
> missedHeartBeatToleranceSecs) {
// heartbeat too old
// no heartbeat or heartbeat too old
Copy link
Contributor

Choose a reason for hiding this comment

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

add this above line 1946

@Andyz26 Andyz26 had a problem deploying to Integrate Pull Request December 18, 2024 20:30 — with GitHub Actions Failure
@Andyz26 Andyz26 merged commit 35a0826 into master Dec 18, 2024
4 of 5 checks passed
@Andyz26 Andyz26 deleted the andyz/fixHBRaceCase1218 branch December 18, 2024 20:47
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.

3 participants