Skip to content

Conversation

@zsxwing
Copy link
Member

@zsxwing zsxwing commented Nov 25, 2015

In the previous codes, newDaemonCachedThreadPool uses SynchronousQueue, which is wrong. SynchronousQueue is an empty queue that cannot cache any task. This patch uses LinkedBlockingQueue to fix it along with other fixes to make sure newDaemonCachedThreadPool can use at most maxThreadNumber threads, and after that, cache tasks to LinkedBlockingQueue.

…e any task

In the previous codes, newDaemonCachedThreadPool uses SynchronousQueue, which is wrong. SynchronousQueue is an empty queue that cannot cache any task. This patch uses LinkedBlockingQueue to fix it along with other fixes to make sure newDaemonCachedThreadPool can use at most `maxThreadNumber` threads, and after that, cache tasks to LinkedBlockingQueue.
@srowen
Copy link
Member

srowen commented Nov 25, 2015

Seems fine to me.

@SparkQA
Copy link

SparkQA commented Nov 26, 2015

Test build #46714 has finished for PR 9978 at commit b870612.

  • This patch fails from timeout after a configured wait of 250m.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):\n * public final class OneWayMessage implements RequestMessage\n

@zsxwing
Copy link
Member Author

zsxwing commented Nov 26, 2015

retest this please

@SparkQA
Copy link

SparkQA commented Nov 26, 2015

Test build #46735 has finished for PR 9978 at commit b870612.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

asfgit pushed a commit that referenced this pull request Nov 26, 2015
…eadPool doesn't cache any task

In the previous codes, `newDaemonCachedThreadPool` uses `SynchronousQueue`, which is wrong. `SynchronousQueue` is an empty queue that cannot cache any task. This patch uses `LinkedBlockingQueue` to fix it along with other fixes to make sure `newDaemonCachedThreadPool` can use at most `maxThreadNumber` threads, and after that, cache tasks to `LinkedBlockingQueue`.

Author: Shixiong Zhu <[email protected]>

Closes #9978 from zsxwing/cached-threadpool.

(cherry picked from commit d3ef693)
Signed-off-by: Shixiong Zhu <[email protected]>
@asfgit asfgit closed this in d3ef693 Nov 26, 2015
asfgit pushed a commit that referenced this pull request Nov 26, 2015
…eadPool doesn't cache any task

In the previous codes, `newDaemonCachedThreadPool` uses `SynchronousQueue`, which is wrong. `SynchronousQueue` is an empty queue that cannot cache any task. This patch uses `LinkedBlockingQueue` to fix it along with other fixes to make sure `newDaemonCachedThreadPool` can use at most `maxThreadNumber` threads, and after that, cache tasks to `LinkedBlockingQueue`.

Author: Shixiong Zhu <[email protected]>

Closes #9978 from zsxwing/cached-threadpool.

(cherry picked from commit d3ef693)
Signed-off-by: Shixiong Zhu <[email protected]>
@zsxwing
Copy link
Member Author

zsxwing commented Nov 26, 2015

merged to master/1.6/1.5/1.4

asfgit pushed a commit that referenced this pull request Nov 26, 2015
…eadPool doesn't cache any task

In the previous codes, `newDaemonCachedThreadPool` uses `SynchronousQueue`, which is wrong. `SynchronousQueue` is an empty queue that cannot cache any task. This patch uses `LinkedBlockingQueue` to fix it along with other fixes to make sure `newDaemonCachedThreadPool` can use at most `maxThreadNumber` threads, and after that, cache tasks to `LinkedBlockingQueue`.

Author: Shixiong Zhu <[email protected]>

Closes #9978 from zsxwing/cached-threadpool.

(cherry picked from commit d3ef693)
Signed-off-by: Shixiong Zhu <[email protected]>
@zsxwing zsxwing deleted the cached-threadpool branch November 26, 2015 07:38
ghost pushed a commit to dbtsai/spark that referenced this pull request Dec 3, 2015
…r and AppClient

`SynchronousQueue` cannot cache any task. This issue is similar to apache#9978. It's an easy fix. Just use the fixed `ThreadUtils.newDaemonCachedThreadPool`.

Author: Shixiong Zhu <[email protected]>

Closes apache#10108 from zsxwing/fix-threadpool.
asfgit pushed a commit that referenced this pull request Dec 3, 2015
…r and AppClient

`SynchronousQueue` cannot cache any task. This issue is similar to #9978. It's an easy fix. Just use the fixed `ThreadUtils.newDaemonCachedThreadPool`.

Author: Shixiong Zhu <[email protected]>

Closes #10108 from zsxwing/fix-threadpool.

(cherry picked from commit 649be4f)
Signed-off-by: Shixiong Zhu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants