Skip to content

Conversation

@shanthoosh
Copy link
Collaborator

Summary

Launching the job-scheduler fails with the following exception

2025-11-23 18:25:18,911 main WARN JNDI lookup class is not available because this JRE does not support JNDI. JNDI string lookups will not be available, continuing configuration. Ignoring java.lang.IllegalStateException: JNDI must be enabled by setting log4j2.enableJndiLookup=true
2025-11-23 18:25:19 INFO  Reflections:219 - Reflections took 162 ms to scan 3 urls, producing 8 keys and 20 values
Exception in thread "main" java.lang.ExceptionInInitializerError
Caused by: java.lang.RuntimeException: Cannot access OPERATION_TYPE field
	at com.linkedin.openhouse.jobs.scheduler.JobsScheduler.lambda$static$0(JobsScheduler.java:109)
	at java.base/java.lang.Iterable.forEach(Iterable.java:75)
	at com.linkedin.openhouse.jobs.scheduler.JobsScheduler.<clinit>(JobsScheduler.java:100)

JobScheduler initialization discovers all sub-classes of OperationTask class through reflection and initializes them.
In #394 , a new sub-class of OperationTask viz the DatabaseOperationTask (abstract class) was added. The abstract class does not have operation-type as a field and it cannot be instantiated. This was not excluded from the JobScheduler initialization thereby causing the above failure.

Fix:

This patch addresses the problem, by excluding DatabaseOperationTask from job scheduler initialization and reenables the JobScheduler test.

Changes

  • Client-facing API Changes
  • Internal API Changes
  • Bug Fixes
  • New Features
  • Performance Improvements
  • Code Style
  • Refactoring
  • Documentation
  • Tests

For all the boxes checked, please include additional details of the changes made in this pull request.

Testing Done

  • Manually Tested on local docker setup. Please include commands ran, and their output.
  • Added new tests for the changes made.
  • Updated existing tests to reflect the changes made.
  • No tests added or updated. Please explain why. If unsure, please feel free to ask for help.
  • Some other form of testing like staging or soak time in production. Please explain.

For all the boxes checked, include a detailed description of the testing done for the changes made in this pull request.

Additional Information

  • Breaking Changes
  • Deprecations
  • Large PR broken into smaller PRs, and PR plan linked in the description.

For all the boxes checked, include additional details of the changes made in this pull request.

Copy link
Member

@abhisheknath2011 abhisheknath2011 left a comment

Choose a reason for hiding this comment

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

Thanks for fixing jobs scheduler initialization issue!

import org.mockito.MockitoAnnotations;

@TestInstance(TestInstance.Lifecycle.PER_CLASS)
@Disabled(
Copy link
Member

Choose a reason for hiding this comment

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

Running this test might take time. Please check how much time it takes before enabling it.

Copy link
Member

Choose a reason for hiding this comment

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

We might need to enable it through env variable and ensure that this test can be run as part of local build.

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