-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
API Services Fail to Start Silently #5820
Comments
@halibobo1205 In addition to api services, do other services also have such demands? |
@zeusoo001, IMHO: external services should not silently fail to start, such as event-plugins. |
external services :
|
Force-enabled services: |
Do you mean that if API services fail to start, they need to throw real-time exception errors instead of only reporting errors when accessing the interface? This may require adjusting the priority of each service startup. It would be great if the startup mechanism could be optimized and error feedback could be provided. |
|
@halibobo1205 |
@halibobo1205 Should you check whether some configured ports are occupied before the main thread starts ? |
@317787106 There is no need to do this, just throw the associated error. See besu how to deal with this: private void waitForServiceToStart(
final String serviceName, final CompletableFuture<?> startFuture) {
do {
try {
startFuture.get(60, TimeUnit.SECONDS);
} catch (final InterruptedException e) {
Thread.currentThread().interrupt();
throw new IllegalStateException("Interrupted while waiting for service to start", e);
} catch (final ExecutionException e) {
throw new IllegalStateException("Service " + serviceName + " failed to start", e);
} catch (final TimeoutException e) {
LOG.warn("Service {} is taking an unusually long time to start", serviceName);
}
} while (!startFuture.isDone());
} |
@lxcmyf I don't think it's necessary, the error is even less clear, and the original error is still needed, you can see the sample above. |
Working on this. |
Is it necessary to exit the node service? PTAL @317787106 @lxcmyf @tomatoishealthy |
At present, some products I have used will not interrupt the main process when encountering some non-core service exceptions. Maybe TRON does not need to be forced to stop in this scenario? But this is a very open topic, and it is also reasonable to stop the service when an exception is thrown. I'd probably prefer to keep the service running, but I'd be fine with either. |
Final decision: exit the node service when API services fail to start. cc @tomatoishealthy |
Software Versions
OS: Linux
JVM: Oracle Corporation 1.8.0_161 AMD64
Version: 4.7.4
Code: 18260
Expected behavior
An exception should be thrown and the node service should exit when the API services fail to start.
Actual behavior
Node starts with no API services and no exception about it thrown.
Steps to reproduce the behavior
Backtrace
The text was updated successfully, but these errors were encountered: