-
Notifications
You must be signed in to change notification settings - Fork 579
Description
Bug Type (问题类型)
logic (逻辑设计问题)
Before submit
- 我已经确认现有的 Issues 与 FAQ 中没有相同 / 重复问题 (I have confirmed and searched that there are no similar problems in the historical issue and documents)
Environment (环境信息)
Server Version: N/A (Found in Source Code Analysis / Master Branch)
Backend: N/A
OS: N/A
Data Size: N/A
Expected & Actual behavior (期望与实际表现)
Expected Behavior:
When Consumers threads encounter a critical error (e.g., inside ContextCallable initialization or an Error that escapes the internal try-catch), the exception should be logged or propagated to the UncaughtExceptionHandler to alert the system.
Actual Behavior:
In Consumers.java, tasks are submitted using executor.submit(...) (Line 110), but the returned Future is never checked (no future.get() is called in await() or elsewhere). This causes a "swallowed exception" scenario:
-
Exceptions occurring outside the runAndDone() internal try-catch block (e.g., in ContextCallable wrapper or strictly internal JVM errors) are captured by the Future.
-
Since the Future is ignored, these exceptions remain invisible. The system believes the consumer is running, but the thread may have terminated silently.
Code / Logs:
// Consumers.java
public void start(String name) {
// ...
for (int i = 0; i < this.workers; i++) {
// Problem: 'submit' is used but the returned Future is never checked via .get()
// If an exception happens outside runAndDone's try-catch, it is swallowed.
this.runningFutures.add(
this.executor.submit(new ContextCallable<>(this::runAndDone)));
}
}
Recommendation:
Change submit() to execute() if the return value is not needed, which allows the JVM's UncaughtExceptionHandler to catch unhandled exceptions. Or ensure future.get() is checked during the lifecycle management.
Vertex/Edge example (问题点 / 边数据举例)
N/ASchema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构)
N/A