dbiir / dbiir/TS-Benchmark

TSBM - queue.take blocking

Open
#5 1 comment 0 reactions 1 assignee Claimed by @ylin30 View on GitHub
Dominant language
Jupyter Notebook
Stars
24
Forks
10
PR merge metrics
No merged PRs in 30d

Description

queue.take() will hang forever and block thread2.join and thread3.join later. You can use queue.poll(timeout, unit) instead.

@@ -255,9 +258,9 @@ public class TSBM {
break;
}
try {
- String data = queue.take();
+ String data = queue.poll(100, TimeUnit.MILLISECONDS);
if (data == null) {
- Thread.sleep(100);
+ //Thread.sleep(100);
continue;
}
adapter.insertData(data);
@@ -265,6 +268,7 @@ public class TSBM {
e.printStackTrace();
}

![image](https://user-images.githubusercontent.com/6943113/140549304-c4478916-9b0b-4d1b-8669-23f1d1f1b800.png)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.