RockteMQ-AI commented on issue #265:
URL:
https://github.com/apache/rocketmq-connect/issues/265#issuecomment-5771481047
**Issue Evaluation**
Category: `bug` | Status: **Confirmed**
This is a valid bug report. The `ClassCastException` occurs because
`WorkerTask#run()` attempts to cast a `Runnable` (returned by
`taskThread.getTask()`) to a `FutureTask`, which is an incompatible type.
**Root Cause:** Type mismatch in `WorkerTask#run()` — `taskThread.getTask()`
returns a `Runnable` but the code casts it to `FutureTask` without checking the
actual type.
**Impact:** Connector tasks crash at runtime with `ClassCastException`,
making the affected connectors non-functional.
**Severity:** High — complete failure of the affected connector task.
**Stack Trace Analysis:**
```
java.lang.ClassCastException: class java.lang.Runnable cannot be cast to
class java.util.concurrent.FutureTask
at
org.apache.rocketmq.connect.runtime.worker.WorkerTask.run(WorkerTask.java:102)
```
**Proposed Fix:** Either:
1. Change `taskThread.getTask()` to return `FutureTask` if that is the
intended type, or
2. Remove the cast and handle the `Runnable` directly, or
3. Add an `instanceof` check before casting.
A fix proposal has been filed in #266.
---
*Automated evaluation by github-manager*
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]