Skip to content

Commit 56d457c

Browse files
Ollie Colemeta-codesync[bot]
authored andcommitted
Update documentation for folly::Subprocess::pollUnchecked
Summary: Previously it was stated that this method would certainly call `CalledProcessError` if the process has exited. However, for instances where the poll does not go through due to the process already having exited, this is not the case and the function will throw a std::logic_error. To avoid confusion here, I have added clarifications on the exact behaviour for future travellers. Context: https://fb.workplace.com/groups/560979627394613/permalink/3546349242190955/ Reviewed By: dmm-fb Differential Revision: D91219516 fbshipit-source-id: 2d8a18b16a4d71c65ae8b319fe873d6fb5b24783
1 parent 521afaf commit 56d457c

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

folly/Subprocess.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -659,6 +659,10 @@ class Subprocess {
659659
* Poll the child's status. If the process is still running, return false.
660660
* Otherwise, return true if the process exited with status 0 (success),
661661
* or throw CalledProcessError if the process exited with a non-zero status.
662+
* Note: this should only be called for processes in the RUNNING state. If
663+
* another trigger has caused the process to register as exited, or the
664+
* process is yet to start before this is called, this will throw a
665+
* std::logic_error.
662666
*/
663667
bool pollChecked();
664668

0 commit comments

Comments
 (0)