Skip to content
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

tr hanging issue #491

Closed
dkarnikis opened this issue Mar 11, 2022 · 5 comments · Fixed by #495
Closed

tr hanging issue #491

dkarnikis opened this issue Mar 11, 2022 · 5 comments · Fixed by #495
Labels
bug Something isn't working

Comments

@dkarnikis
Copy link
Collaborator

When running:
$PASH_TOP/pa.sh -c "cat $PASH_TOP/evaluation/tests/input/10M.txt | tr -s ' ' ''"

I get:
tr: when not truncating set1, string2 must be non-empty
and then the execution hangs, whereas the bash exits

Running on 0e2c84a
OS: Debian-10 (supported OS) and Ubuntu-21.10

@dkarnikis dkarnikis added the bug Something isn't working label Mar 11, 2022
@angelhof
Copy link
Member

It probably has to do with quoting... If you run pash with -d 1, what is the script that is actually executed? Someone needs to fix quoting at some point BTW, maybe we should add an issue with some tests for someone to investigate properly. Having multiple mini-issues for quoting doesn't help a lot I think (assuming that the problem is quoting here 🙃)

@nvasilakis
Copy link
Collaborator

Agreed! We need to fix it:-)

@tammam1998
Copy link
Collaborator

I think this is unrelated to the quoting problem. The problem here is that the pa.sh hangs after the error while bash exits. I tried this with --r_split and it exits correctly. I think this might have to do with auto-split not handling errors correctly. I can look into it.

On another note, I think I might have a solution for the quoting problem but it would be great if we have some test cases that currently fail to make sure the solution works.

@angelhof
Copy link
Member

I think you are right, it is not actually quoting! It has to do with improper termination.
It is unclear to me whether the problem is solved due to the r_split, r_wrap, or r_merge though.

To debug this, we probably need to figure out which processes are alive and which ones are killed at runtime.

BTW, this makes me think that it would be a good idea to invest some energy into a proper debugging/monitoring extension for PaSh. Something that we can query at runtime to get information about running processes that were spawned by pash, and their status. This would also be useful for the distributed execution usability and debugging (being able to monitor which processes are running on which machine, etc). One simple and non-invasive way to do that, would be to log information about processes, and then make a different consumer for these logs that can be used to inspect them in a nice way. Would anyone be interested in working on that? What do others think (@nvasilakis, @mgree, @tammam1998)?

@tammam1998 tammam1998 linked a pull request Mar 12, 2022 that will close this issue
@mgree
Copy link
Collaborator

mgree commented Mar 13, 2022

Logging is definitely the easiest way to go. Ideally we could group logs by shell $PPID, i.e., the PID of the invoker of pash.

As for precis format, I know there are bunch of tools for processing JSON logs in various states. It might be easiest to adopt something of the form:

TIMESTAMP [TAGS/SUBSYSTEM]: message

But you know me: I'll use grep before jq or gron.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants