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

Wrong log number of threads of scheduler #517

Open
adamalexandru4 opened this issue Jul 19, 2024 · 1 comment
Open

Wrong log number of threads of scheduler #517

adamalexandru4 opened this issue Jul 19, 2024 · 1 comment
Labels

Comments

@adamalexandru4
Copy link

Expected Behavior

The log message on Scheduler.build() prints out the number of threads from default value (executorThreads), not from the real executor service used.

Current Behavior

ExecutorService candidateExecutorService = executorService;
    if (candidateExecutorService == null) {
      candidateExecutorService =
          Executors.newFixedThreadPool(
              executorThreads, defaultThreadFactoryWithPrefix(THREAD_PREFIX + "-"));
    }

    ExecutorService candidateDueExecutor = dueExecutor;
    if (candidateDueExecutor == null) {
      candidateDueExecutor =
          Executors.newSingleThreadExecutor(
              defaultThreadFactoryWithPrefix(THREAD_PREFIX + "-execute-due-"));
    }

    ScheduledExecutorService candidateHousekeeperExecutor = housekeeperExecutor;
    if (candidateHousekeeperExecutor == null) {
      candidateHousekeeperExecutor =
          Executors.newScheduledThreadPool(
              3, defaultThreadFactoryWithPrefix(THREAD_PREFIX + "-housekeeper-"));
    }

    LOG.info(
        "Creating scheduler with configuration: threads={}, pollInterval={}s, heartbeat={}s enable-immediate-execution={}, table-name={}, name={}",
        executorThreads,
        waiter.getWaitDuration().getSeconds(),
        heartbeatInterval.getSeconds(),
        enableImmediateExecution,
        tableName,
        schedulerName.getName());
@kagkarlsson
Copy link
Owner

Thank you for reporting. If the ExecutorService is externally managed, I don't think we know anything about number of threads, so the solution here is probably to only log if not externally managed.. (maybe also see if there are other important configuration parameterns that could be logged)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants