Skip to content

fix(job): log one line when a scheduled job cannot be selected - #4038

Merged
marevol merged 1 commit into
mainfrom
fix/scheduled-job-select-warn-one-line
Dec 4, 2026
Merged

marevol merged 1 commit into
mainfrom
fix/scheduled-job-select-warn-one-line

Conversation

@marevol

@marevol marevol commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Problem

While the search engine is unavailable, every scheduled job that fires cannot be selected, and ScheduledJobBhv#selectByPK logs Failed to select a job by <id> with a full stack trace each time. With jobs that fire every minute this fills fess.log with the same traces for as long as the outage lasts.

Change

The warning is now one line, Failed to select a job: id=<id>, reason=<exception>, followed by the root cause if there is one. The stack trace of each attempt is still logged at DEBUG, as before. Retries and the return value are unchanged.

Tests

  • No new unit test: the change is to a log statement behind the retry loop, which sleeps for about a minute or more before giving up.
  • Checked on a running Fess with the search engine stopped: without the change the warnings carry stack frames; with it they are single lines with the cause, and the cron job runs again after the engine returns.

@marevol marevol added this to the 15.10.0 milestone Dec 4, 2026
While the search engine is away, every scheduled job that fires fails to
select itself and logged a warning with a full stack trace each time. The
warning is now one line with the exception and its root cause; the stack
trace of each attempt is still logged at DEBUG.
@marevol
marevol force-pushed the fix/scheduled-job-select-warn-one-line branch from e8491c6 to da43861 Compare December 4, 2026 08:36
@marevol marevol self-assigned this Dec 4, 2026
@marevol
marevol merged commit c9ad2ac into main Dec 4, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant