arpadboda commented on a change in pull request #735: MINIFICPP-1158 - Event
driven processors can starve each other
URL: https://github.com/apache/nifi-minifi-cpp/pull/735#discussion_r383973772
##########
File path: libminifi/include/EventDrivenSchedulingAgent.h
##########
@@ -39,21 +41,28 @@ class EventDrivenSchedulingAgent : public
ThreadedSchedulingAgent {
* Create a new event driven scheduling agent.
*/
EventDrivenSchedulingAgent(std::shared_ptr<core::controller::ControllerServiceProvider>
controller_service_provider, std::shared_ptr<core::Repository> repo,
- std::shared_ptr<core::Repository> flow_repo,
std::shared_ptr<core::ContentRepository> content_repo,
std::shared_ptr<Configure> configuration)
- : ThreadedSchedulingAgent(controller_service_provider, repo, flow_repo,
content_repo, configuration) {
- }
- // Destructor
- virtual ~EventDrivenSchedulingAgent() {
+ std::shared_ptr<core::Repository> flow_repo,
std::shared_ptr<core::ContentRepository> content_repo,
std::shared_ptr<Configure> configuration,
+
std::shared_ptr<utils::ThreadPool<utils::ComplexTaskResult>> thread_pool)
+ : ThreadedSchedulingAgent(controller_service_provider, repo, flow_repo,
content_repo, configuration, thread_pool) {
+ int slice =
configuration->getInt(Configure::nifi_flow_engine_event_driven_time_slice,
DEFAULT_TIME_SLICE_MS);
+ if (slice < 10 || 1000 < slice) {
+ throw Exception(FLOW_EXCEPTION,
std::string(Configure::nifi_flow_engine_event_driven_time_slice) + " is out of
reasonable range!");
Review comment:
0 doesn't seem to be valid for me as the processor could only process 1 FF
before getting back to the end of the queue, that looks pretty bad for me.
On the other end, lasting more than 1s seems like starvation for me, I don't
think that should happen. In case that happens, I would consider that as an
error.
----------------------------------------------------------------
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