szaszm commented on a change in pull request #735: WIP: MINIFICPP-1158 - Event
driven processors can starve each other
URL: https://github.com/apache/nifi-minifi-cpp/pull/735#discussion_r382024074
##########
File path:
libminifi/include/core/controller/StandardControllerServiceProvider.h
##########
@@ -103,14 +103,13 @@ class StandardControllerServiceProvider : public
ControllerServiceProvider, publ
}
- std::future<uint64_t>
enableControllerService(std::shared_ptr<ControllerServiceNode> &serviceNode) {
+ std::future<utils::ComplexResult>
enableControllerService(std::shared_ptr<ControllerServiceNode> &serviceNode) {
if (serviceNode->canEnable()) {
return agent_->enableControllerService(serviceNode);
} else {
- std::future<uint64_t> no_run = std::async(std::launch::async, []() {
- uint64_t ret = 0;
- return ret;
+ std::future<utils::ComplexResult> no_run =
std::async(std::launch::async, []() {
+ return utils::Done();
});
return no_run;
Review comment:
Wasn't introduced by you but I don't think that we need to execute the
return of a small and simple struct on a separate thread, or even allow that.
I'd change `std::launch::async` to `std::launch::deferred`.
My suggestion:
```
return std::async(std::launch::deferred, &utils::Done);
```
The same applies to `disableControllerService`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services