Jira (PDB-5018) Provide way to stop/start command processing using ExecutorService

16 views
Skip to first unread message

Bogdan Irimie (Jira)

unread,
Feb 10, 2021, 10:19:03 AM2/10/21
to puppe...@googlegroups.com
Bogdan Irimie created an issue
 
PuppetDB / Task PDB-5018
Provide way to stop/start command processing using ExecutorService
Issue Type: Task Task
Assignee: Unassigned
Created: 2021/02/10 7:18 AM
Priority: Normal Normal
Reporter: Bogdan Irimie
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Bogdan Irimie (Jira)

unread,
Feb 10, 2021, 10:19:03 AM2/10/21
to puppe...@googlegroups.com
Bogdan Irimie updated an issue
Change By: Bogdan Irimie
It's possible the that the [Executor|https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ExecutorService.html] created in the [GatedThreadpool|https://github.com/puppetlabs/puppetdb/blob/main/src/puppetlabs/puppetdb/threadpool.clj#L89] defrecord. Has the ability to pause incoming tasks. We haven't looked through the docs in detail but it would be worth checking out before going with option 1 to see if this is possible.

Bogdan Irimie (Jira)

unread,
Feb 10, 2021, 10:24:03 AM2/10/21
to puppe...@googlegroups.com

Bogdan Irimie (Jira)

unread,
Feb 10, 2021, 10:24:03 AM2/10/21
to puppe...@googlegroups.com

Bogdan Irimie (Jira)

unread,
Feb 10, 2021, 11:38:03 AM2/10/21
to puppe...@googlegroups.com
Bogdan Irimie updated an issue
Provide a way to stop and start command processing, perhaps initially only internally, say via a service method. This should help reduce the complexity/fragility of some of the tests.

While we might want to eventually support some public way to control this, that can come later.

 

It's possible the that the [Executor|https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ExecutorService.html] created in the [GatedThreadpool|https://github.com/puppetlabs/puppetdb/blob/main/src/puppetlabs/puppetdb/threadpool.clj#L89] defrecord. Has the ability to pause incoming tasks. We haven't looked through the docs in detail but it would be worth checking out before going with option 1 to see if this is possible.

Bogdan Irimie (Jira)

unread,
Feb 12, 2021, 11:37:04 AM2/12/21
to puppe...@googlegroups.com

Bogdan Irimie (Jira)

unread,
Feb 15, 2021, 11:39:03 AM2/15/21
to puppe...@googlegroups.com
Bogdan Irimie commented on Task PDB-5018
 
Re: Provide way to stop/start command processing using ExecutorService

dochan function receives a thread that implements ExecutorService interface. The actual implementation of the thread pool ThreadPoolExecutor. The ThreadPoolExecutor does not implement `pause`, but an example is given in the docs how one might extend the ThreadPoolExecutor and create a PausableThreadPoolExecutor.

Bogdan Irimie (Jira)

unread,
Feb 17, 2021, 3:26:04 AM2/17/21
to puppe...@googlegroups.com
Bogdan Irimie commented on Task PDB-5018

After presenting the findings to Zachary Kent and Austin Blatt we decided to go for the implementation proposed by Rob Browning in PDB-4524.

Reply all
Reply to author
Forward
0 new messages