[IOTDB-1084] Fix temporary memory of flushing may cause OOM#2358
[IOTDB-1084] Fix temporary memory of flushing may cause OOM#2358JackieTien97 merged 12 commits intomasterfrom
Conversation
SilverNarcissus
left a comment
There was a problem hiding this comment.
Look good to me~
SilverNarcissus
left a comment
There was a problem hiding this comment.
Fantastic work! But there are some issues, please have a look.
| @@ -170,94 +189,104 @@ private void writeOneSeries(TVList tvPairs, IChunkWriter seriesWriterImpl, | |||
| @Override | |||
| public void run() { | |||
| long memSerializeTime = 0; | |||
There was a problem hiding this comment.
You should use class variable memSerializeTime rather than this local variable
| private volatile boolean noMoreEncodingTask = false; | ||
| private volatile boolean noMoreIOTask = false; | ||
| private long memSerializeTime = 0L; | ||
| private long ioTime = 0L; |
There was a problem hiding this comment.
These two variable will be written and read by different thread without locking. The situation is only one thread to write, so no locking is reasonable, but they should be volatile so they can be seen by another thread.
|
|
||
| @SuppressWarnings("squid:S135") | ||
| private Runnable ioTask = () -> { | ||
| long ioTime = 0; |
There was a problem hiding this comment.
You should use class variable ioTime rather than this local variable
SilverNarcissus
left a comment
There was a problem hiding this comment.
Look good to me~
|
Kudos, SonarCloud Quality Gate passed!
|
This PR has:
for an unfamiliar reader.
for code coverage.
Key changed/added classes (or packages if there are too many classes) in this PR