Skip to content

[ZEPPELIN-6546] Restore Math.max accumulation for NoteJobInfo.unixTimeLastRun#5319

Open
HwangRock wants to merge 2 commits into
apache:masterfrom
HwangRock:ZEPPELIN-6546
Open

[ZEPPELIN-6546] Restore Math.max accumulation for NoteJobInfo.unixTimeLastRun#5319
HwangRock wants to merge 2 commits into
apache:masterfrom
HwangRock:ZEPPELIN-6546

Conversation

@HwangRock

@HwangRock HwangRock commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

What is this PR for?

Job Manager reports a wrong "last run" time for any note whose most recently executed paragraph is not the last paragraph in the note.

NoteJobInfo(Note) in JobManagerService overwrites lastRunningUnixTime on every loop iteration, so the last paragraph always wins:

lastRunningUnixTime = getUnixTimeLastRunParagraph(paragraph);

Consequences:

  • Both UIs render and sort by unixTimeLastRun (jobmanager.filter.js in zeppelin-web, job-manager.component.ts in zeppelin-web-angular), so the displayed relative time and the Recently-Update sort order are wrong.
  • The incremental path getNoteJobInfoByUnixTime() filters with unixTimeLastRun > lastUpdateServerUnixTime, so a note that just ran can be silently dropped from LIST_UPDATE_NOTE_JOBS pushes when an older paragraph sits at the bottom.

This is a regression of ZEPPELIN-2860, which fixed exactly this in 2017 with Math.max (#2543). The ZEPPELIN-3737 refactor moved the logic from NotebookServer into JobManagerService and dropped the Math.max (001c621). This PR restores it.

Verified on a live server: a two-paragraph note whose first paragraph finished today and whose second paragraph was created 8 days ago and never ran showed "8 days ago" in Job Manager before the fix and the correct run time after.

Screenshots (if appropriate)

2026-07-18.6.37.10.mov

What type of PR is it?

Bug Fix

Todos

  • Restore Math.max accumulation in NoteJobInfo
  • Regression tests

What is the Jira issue?

https://issues.apache.org/jira/browse/ZEPPELIN-6546

How should this be tested?

mvn test -pl zeppelin-server -Dtest=JobManagerServiceTest — the two new tests pin unixTimeLastRun to the max paragraph timestamp via the getNoteJobInfoByUnixTime filter boundary and fail without the fix.

Manually: create a note with two paragraphs, run only the first one, open the Job Manager page. Before the fix the note shows the second paragraph's creation date as its last run and sorts accordingly; after the fix it shows the actual run time.

Questions:

  • Does the license files need to update? No
  • Is there breaking changes for older versions? No
  • Does this needs documentation? No

…eLastRun

The NoteJobInfo constructor overwrote lastRunningUnixTime on every loop
iteration, so a note's last-run time always came from its last paragraph
instead of its most recently run one. This breaks Job Manager sorting and
the incremental LIST_UPDATE_NOTE_JOBS filter, which can silently drop a
note that just ran.

ZEPPELIN-2860 fixed exactly this with Math.max in 2017 (commit 4a369f1).
The ZEPPELIN-3737 refactor (commit 001c621) moved the logic into
JobManagerService and dropped the Math.max, silently reintroducing the
bug. Restore the max accumulation.
Two tests build a note whose first paragraph finished recently while the
last paragraph was created earlier and never ran, then pin the computed
unixTimeLastRun through the getNoteJobInfoByUnixTime filter boundary:
the note must be included for thresholds below the newest paragraph
timestamp and excluded at exactly that timestamp. Both tests fail
without the Math.max restoration.
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.

1 participant