-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Environment
-
Ptubes version: 1.0.0
-
Operating System version: Linux
-
Java version: 1.8
Steps to reproduce this issue
The "onChannelDisconnect" function in class NettyHttpRdsCdcReaderConnection will enqueue another state object into "messageQueue" of the fetch thread When the netty connection is lost.
private void onChannelDisconnect() {
log.warn("Fetch thread disconnected from remote server " + targetServer);
if (!this.getState()
.equals(State.CLOSING) && !this.getState()
.equals(State.CLOSED)) {
this.fetchThreadState.setStateId(FetchThreadState.StateId.PICK_SERVER);
this.fetchThread.enqueueMessage(this.fetchThreadState); // it is
this.setState(State.CLOSED);
} else {
log.warn("Fetch thread connection is already closed.");
}
}The bug may cause a data loss risk. Because two state in "messageQueue" of the fetch thread will cause two fetching reader event in a short time. Meanwhile, the dispatch class is a a non-thread-safe while doing events distribution.
Expected Behavior
Only one state object contains in the "messageQueue" of the fetch thread.
Actual Behavior
There is more than one state object exists in "messageQueue" of the fetch thread.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working