westonpace commented on PR #14524:
URL: https://github.com/apache/arrow/pull/14524#issuecomment-1295423847

   > A different interface that could be simpler is to simply change the 
meaning of End to mean "End when empty but allow adding more tasks" instead of 
"End when empty but disallow adding more tasks".
   
   You are now allowed to add tasks after a scheduler is "ended".  The 
top-level scheduler basically starts "ended" (after the initial task runs).  If 
you don't use or need sub-schedulers then we have what you describe.
   
   However, there are some cases where we don't want a sub-scheduler to end 
even though it has run out of tasks.  For example, when writing to a file.  We 
want to close the file when all write tasks have finished.  However, we don't 
know, at the start, how many write tasks there will be, and we don't have all 
of them (sometimes InputReceived will add another write task and sometimes it 
won't, depends on partitioning).
   
   That being said, we still want to end the file writer no matter what when 
the plan itself is out of tasks.  At that point there is no possible way we 
could add more write tasks so the fact that it hasn't been ended is probably a 
bug or an error condition we don't explicitly handle and so we should just 
abort what we were doing and close the file.


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to