Skip to content
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

[IOTDB-3459] Make sure SignalWALEntry be pushed to the queue successfully in close() #6241

Merged
merged 1 commit into from Jun 12, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 10 additions & 2 deletions server/src/main/java/org/apache/iotdb/db/wal/buffer/WALBuffer.java
Expand Up @@ -200,7 +200,11 @@ private boolean handleWALEntry(WALEntry walEntry) {
return false;
}

/** @return true if serialization is successful. */
/**
* Handle a normal WALEntry.
*
* @return true if serialization is successful.
*/
private boolean handleInfoEntry(WALEntry walEntry) {
try {
walEntry.serialize(byteBufferVew);
Expand Down Expand Up @@ -476,7 +480,11 @@ public void close() {
// first waiting serialize and sync tasks finished, then release all resources
if (serializeThread != null) {
// add close signal WALEntry to notify serializeThread
walEntries.add(new SignalWALEntry(SignalWALEntry.SignalType.CLOSE_SIGNAL));
try {
walEntries.put(new SignalWALEntry(SignalWALEntry.SignalType.CLOSE_SIGNAL));
} catch (InterruptedException e) {
logger.error("Fail to put CLOSE_SIGNAL to walEntries.", e);
}
shutdownThread(serializeThread, ThreadName.WAL_SERIALIZE);
}
if (syncBufferThread != null) {
Expand Down