Skip to content
New issue

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

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

Already on GitHub? # to your account

fix read stderr during command execution #47

Merged
merged 1 commit into from
Jan 23, 2021

Conversation

ghost
Copy link

@ghost ghost commented Aug 5, 2020

Currently stderr is only read after stdout ended sending (= after the called bash command ended). With this change, stderr and stdout is read simultanously via two separate threads to make it possible that stderr is read before the command ended.

How to test this

Create file test-stderr.sh:

#/bin/bash

for number in {1..15}
do
	>&2 echo "$number ..."
	sleep 1
done

exit 0

Create file test-stdout.sh:

#/bin/bash

for number in {1..15}
do
	echo "$number ..."
	sleep 1
done

exit 0

When you set up a pipeline with a RunBash command calling test-stdout.sh, you will see the output during execution. When you do the same with calling test-stderr.sh, you will get the log output in mara only after the shell script ended.

With this pull request, this behavior will change so that stdout/stderr reading happens during command execution, so, test-stderr.sh will show the log output right away. You don't have to wait until the shell command ended before you can see stderr in the mara log.

Currently stderr is only read after stdout ended sending (= after the called bash command ended). With this change, stderr and stdout is read simultanously via two separate threads to make it possible that stderr is read before the command ended.
@ghost ghost requested a review from martin-loetzsch August 18, 2020 09:02
@ghost ghost added the bug Something isn't working label Sep 15, 2020
@martin-loetzsch
Copy link
Member

Thanks!

@martin-loetzsch martin-loetzsch merged commit 434b935 into master Jan 23, 2021
@martin-loetzsch martin-loetzsch deleted the fix-stderr-reading branch March 8, 2021 22:47
martin-loetzsch added a commit that referenced this pull request Mar 8, 2021
- Fix CopyIncrementally with no data (#54)
- Add ability to specify modification value type in CopyIncrementally (#53)	66e7dc1	Jan Katins <jan.katins@zenjob.com>	4. Mar 2021 at 22:06
- Fix read stderr during command execution (#47)
- Use echo_queries from mara_db.config.default_echo_queries (#58)
- Include all versioned package files in wheel
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants