Fix the queue size in writeThreadPool exceeds the configured size - #3348
Fix the queue size in writeThreadPool exceeds the configured size#3348lordcheng10 wants to merge 2 commits into
Conversation
|
/pulsarbot run-failure-checks |
2 similar comments
|
/pulsarbot run-failure-checks |
|
/pulsarbot run-failure-checks |
|
rerun failure checks |
5 similar comments
|
rerun failure checks |
|
rerun failure checks |
|
rerun failure checks |
|
rerun failure checks |
|
rerun failure checks |
|
@hangc0276 @eolivelli PTAL,thanks! |
|
@shoothzj PTAL,thanks! |
merlimat
left a comment
There was a problem hiding this comment.
This change will cause an incredible amount of mutex contention and big performance regression.
Do you have any good idea about the queue size exceeding the configured size? At present, the queue size we configured cannot control the queue size in high concurrency scenarios. @merlimat |
@merlimat OK, I will try some other solutions. |
| public void execute(Runnable command) { | ||
| this.checkQueue(1); | ||
| super.execute(command); | ||
| synchronized (this) { |
There was a problem hiding this comment.
a style note..... you can push synchronized to the method signature
|
@lordcheng10 +1 to Matteo's concern about performance. |
hangc0276
left a comment
There was a problem hiding this comment.
+1 to Matteo's concern about performance.
Motivation
Fix the queue size in writeThreadPool exceeds the configured size.
I print out the queue size every time I submit a task, and then set the queue size to 1:
maxPendingAddRequestsPerThread=1
The queue size of the log output is greater than 1:
It means that the queue size set by maxPendingAddRequestsPerThread does not limit the queue size.