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

"text file is busy" when running a task and updating a pack at the same time #90

Open
pierec opened this issue Oct 29, 2021 · 0 comments

Comments

@pierec
Copy link

pierec commented Oct 29, 2021

I get a "text file is busy" error when running a task calling a script from a pack that's getting updated within the same task invocation. As far as I can tell this only happens when installing a newer version of already-installed pack. It also may be a Linux-specific issue.

$ oya run test
INFO[0002] Installing pack github.com/foo-inc/oya-packs/foo-py-project version v1.4.0 into "/tmp/oya585242744/github.com/foo-inc/oya-packs/[email protected]" (git tag: foo-py-project/v1.4.0)
INFO[0003] Installing pack github.com/foo-inc/oya-packs/foo-py-project version v1.4.0 into "/home/pierec/.oya/packs/github.com/foo-inc/oya-packs/[email protected]" (git tag: foo-py-project/v1.4.0)
------------------------------------------------------------------------------
Error: fork/exec /home/pierec/.oya/packs/github.com/foo-inc/oya-packs/[email protected]/chkdeps: text file busy

 at line 6, column 1

 5| # If venv is already setup, skip this task
> 6| "${Oya[BasePath]}/chkdeps" \
    ^

------------------------------------------------------------------------------
Error: task "venv" failed

 in github.com/foo-inc/oya-packs/foo-py-project imported as "_py"

------------------------------------------------------------------------------
Error: task "_py.venv" failed

 in file "/home/pierec/coding/tpx/foo/py-lib-logging/Oyafile"

------------------------------------------------------------------------------
Error: exit status 255

 at line 4, column 1

 3| # Make sure "pip-tools" is installed
> 4| oya run venv
    ^

------------------------------------------------------------------------------
Error: task "freeze" failed

 in github.com/foo-inc/oya-packs/foo-py-project imported as "_py"

------------------------------------------------------------------------------
Error: task "_py.freeze" failed

 in file "/home/pierec/coding/tpx/foo/py-lib-logging/Oyafile"

------------------------------------------------------------------------------
Error: exit status 255

 at line 3, column 1

 2|
> 3| oya run freeze
    ^

------------------------------------------------------------------------------
Error: task "test" failed

 in github.com/foo-inc/oya-packs/foo-py-project imported as "_py"

------------------------------------------------------------------------------
Error: task "_py.test" failed

 in file "/home/pierec/coding/tpx/foo/py-lib-logging/Oyafile"

------------------------------------------------------------------------------
Error: exit status 255

 at line 2, column 1

 1| set -e
> 2| oya run _py.test $@
    ^

------------------------------------------------------------------------------
Error: task "test" failed

 in file "/home/pierec/coding/tpx/foo/py-lib-logging/Oyafile"

Let me break that down into a minimal example. Consider a pack the following structure:

$ ls -l
drwxr-xr-x 3 pierec pierec  200 Oct 27 21:05 .
drwxr-xr-x 5 pierec pierec  120 Oct 27 10:57 ..
-rwxr-xr-x 1 pierec pierec  712 Oct 26 23:44 a-shell-script
-rw-r--r-- 1 pierec pierec 4551 Oct 29 19:53 Oyafile

$ cat Oyafile
Project: github.com/foo/some-pack

a-task: |
  set -e
  "${Oya[BasePath]}/a-shell-script"

Consider a project using the above pack:

$ cat Oyafile
Project: github.com/foo/some-project

Require:
  github.com/foo/some-pack: v1.0.0

a-task:
  some-pack.a-task

Steps to reproduce:

  1. git clone some-project to some directory.
  2. Run oya run a-task - no errors.
  3. Update Oyafile to refer to a newer version of some-pack.
  4. Run oya run a-task - "text file is busy" error occurs.
  5. Run oya run a-task again - no errors.
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

1 participant