New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jobs should be marked as completed when all processes are completed, not just the last one #876

Closed
ridiculousfish opened this Issue Jun 16, 2013 · 1 comment

Comments

Projects
None yet
1 participant
@ridiculousfish
Member

ridiculousfish commented Jun 16, 2013

This issue tracks the following change: mark a job as completed only when all processes are finished.

An example of an affected command:

 sleep 10 | echo Hi

Today in fish, this finishes immediately, because echo does not read from its input pipe. With this change, this job will not finish for 10 seconds.

Advantages:

  1. It's arguably more intuitive
  2. It makes it possible to implement pipefail (#763), because we will wait until we have the exit status of all commands in the pipeline
  3. It eliminates a certain class of race conditions that occur if the last process is not in the process group of the session leader (#848)
  4. It matches bash and zsh (though not tcsh)
@ridiculousfish

This comment has been minimized.

Show comment
Hide comment
@ridiculousfish

ridiculousfish Jun 16, 2013

Member

Trying it and seeing how it works out. Fixed as 5d75ee7

Member

ridiculousfish commented Jun 16, 2013

Trying it and seeing how it works out. Fixed as 5d75ee7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment