We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Nacos fails to start when the cpu core is less than 2,Exception appear when start:
java.lang.ExceptionInInitializerError: null at com.alibaba.nacos.naming.healthcheck.AbstractHealthCheckProcessor.<clinit>(AbstractHealthCheckProcessor.java:148) at com.alibaba.nacos.naming.healthcheck.HealthCheckTask.run(HealthCheckTask.java:61) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:756) Caused by: java.lang.IllegalArgumentException: null at java.util.concurrent.ThreadPoolExecutor.<init>(ThreadPoolExecutor.java:1307) at java.util.concurrent.ThreadPoolExecutor.<init>(ThreadPoolExecutor.java:1230) at java.util.concurrent.Executors.newFixedThreadPool(Executors.java:151) at com.alibaba.nacos.naming.healthcheck.MysqlHealthCheckProcessor.<clinit>(MysqlHealthCheckProcessor.java:52) ... 9 common frames omitted
Reason:
private static final ScheduledExecutorService EXECUTOR = Executors .newScheduledThreadPool(Runtime.getRuntime().availableProcessors() / 2, new ThreadFactory() { @Override public Thread newThread(Runnable r) { Thread thread = new Thread(r); thread.setDaemon(true); thread.setName("com.alibaba.nacos.naming.health"); return thread; } });
Runtime.getRuntime().availableProcessors() / 2 value is 0, when invoker ThreadPoolExecutor(), throw new IllegalArgumentException();
public ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory, RejectedExecutionHandler handler) { if (corePoolSize < 0 || maximumPoolSize <= 0 || maximumPoolSize < corePoolSize || keepAliveTime < 0) throw new IllegalArgumentException(); if (workQueue == null || threadFactory == null || handler == null) throw new NullPointerException(); this.corePoolSize = corePoolSize; this.maximumPoolSize = maximumPoolSize; this.workQueue = workQueue; this.keepAliveTime = unit.toNanos(keepAliveTime); this.threadFactory = threadFactory; this.handler = handler; }
The text was updated successfully, but these errors were encountered:
698cf48
fix alibaba#130 (alibaba#131)
8a17a2f
Co-authored-by: wangchunhao <[email protected]>
wyp12
nkorange
No branches or pull requests
Nacos fails to start when the cpu core is less than 2,Exception appear when start:
Reason:
Runtime.getRuntime().availableProcessors() / 2 value is 0, when invoker ThreadPoolExecutor(),
throw new IllegalArgumentException();
The text was updated successfully, but these errors were encountered: