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

/usr/share/beakerlib/testing.sh: line 878: 111: Bad file descriptor #141

Open
lukaszachy opened this issue Sep 2, 2022 · 2 comments
Open

Comments

@lukaszachy
Copy link
Contributor

I can't reproduce this, happens once in a blue moon. This is from internal test so apologies for broken links.
Happened one single arch, unfortunately later tasks don't do 'rlRun -l' so I cannot say if machine got corrupted or it was just a unfortunate resource situation during that one task.

Test: tests/ruby/tree/Sanity/smoke-test/runtest.sh
Output: BEAKER_ARCHIVE_SERVER/beaker-logs/2022/08/69656/6965677/12532692/149528826/taskout.log
Beaker recipe / job: BEAKER_SERVER/recipes/12532692#task149528826

Test isn't doing anything strange, it's roughly

    rlPhaseStartTest "Options"
        rlRun -l "$RUBY --version" 0 "Running $RUBY --version"
        rlRun "$RUBY -e \"puts 'Hello World!'\"" 0 "Running $RUBY -e \"puts 'Hello World'\""

All rlRun -l failed with

/usr/share/beakerlib/testing.sh: line 878: 111: Bad file descriptor

However none of rlRun failed.

@sopos
Copy link
Member

sopos commented Sep 2, 2022

Apparently the non-failing rlRun is cause by bash not giving a non-zero exit code in the following part of the code:

        exec 111> >(sed -u -e "s/^/$__INTERNAL_rlRun_TAG_OUT/g" | tee -a $__INTERNAL_rlRun_LOG_FILE)
        local __INTERNAL_rlRun_OUTpid=$!
        exec 112> >(sed -u -e "s/^/$__INTERNAL_rlRun_TAG_ERR/g" | tee -a $__INTERNAL_rlRun_LOG_FILE)
        local __INTERNAL_rlRun_ERRpid=$!
        eval "$__INTERNAL_rlRun_command" 2>&112 1>&111
        local __INTERNAL_rlRun_exitcode=$?

Seems like the FDs 111 and 112 are being open with on exec lines while the write to it fails on the eval line.

That's about passing rlRun.

About the bad FD: is it possible that there is no more space on the disk left? That might cause the FD to break once the processing code exits.
The $__INTERNAL_rlRun_LOG_FILE points usually somewhere to /var/tmp/beakerlib-XXXX.

Beakerlib might implement an additional check for the FDs 111 and 112 before the actual command execution to issue some more meaningful error.

@lukaszachy
Copy link
Contributor Author

I think disk space is OK but sometimes file descriptors are exhausted (I can't reproduce though).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants