Coder Social home page Coder Social logo

Comments (5)

mpdude avatar mpdude commented on May 27, 2024

I am sure this is the race condition as I initially described. Here is the log output of another run that worked:

PHP version is 7.2.34-21+ubuntu18.04.1+deb.sury.org+1
Operating system is linux
Cache primary key is linux-php-7.2.34-21+ubuntu18.04.1+deb.sury.org+1-locked-bac6c14ffff580a04a4fea1394e68aa862bb682755fbc9d2277682591500a408-
Cache restore keys are: linux-php-7.2.34-21+ubuntu18.04.1+deb.sury.org+1-locked-bac6c14ffff580a04a4fea1394e68aa862bb682755fbc9d2277682591500a408-, linux-php-7.2.34-21+ubuntu18.04.1+deb.sury.org+1-locked-
/usr/local/bin/composer install --no-interaction --no-progress --ansi
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Received 49209747 of 49209747 (100.0%), 123.8 MBs/sec
Cache Size: ~47 MB (49209747 B)
/bin/tar --use-compress-program zstd -d -xf /home/runner/work/_temp/bba28022-b2f5-403f-9ceb-305964208faf/cache.tzst -P -C /home/runner/work/REPO/REPO
Cache restored successfully
Cache restored from key: linux-php-7.2.34-21+ubuntu18.04.1+deb.sury.org+1-locked-bac6c14ffff580a04a4fea1394e68aa862bb682755fbc9d2277682591500a408-
Package operations: 186 installs, 0 updates, 0 removals
  - Syncing webfactory/wfdynamic (3.1.0) into cache

You can see that /usr/local/bin/composer install --no-interaction --no-progress --ansi comes before Cache restored successfully, but this time, the cache was quick enough to be restored before Composer did any git clone operations.

I have no experience with TypeScript or asynchronous programming in JavaScript.

That being said, here is the code from https://github.com/actions/cache that you require() in src/cache/factory.ts:

https://github.com/actions/cache/blob/0638051e9af2c23d10bb70fa9beffcad6cff9ce3/src/restore.ts#L69-L71

The run() call seems to trigger the actual cache restore code; but since that is async, it might take a while to complete. Does run() return a promise in this case, but that promise is never exported from the module?

If that is the case, what does this code here

return async () => await require('cache/dist/restore.js')
wait for?

from composer-install.

ramsey avatar ramsey commented on May 27, 2024

I have no experience with TypeScript or asynchronous programming in JavaScript.

My experience is also limited, but I think calling attention to the fact that there's absolutely asynchronous operations going on here points to a likely smoking gun.

In the code you pointed out, I thought the await told it to wait, but that does seem in conflict with the async keyword. I'll check with some folks who know more about how JS works so I can get this to be more synchronous.

Thanks!

from composer-install.

mpdude avatar mpdude commented on May 27, 2024

Awesome. IMHO the run() in the restore.js file from actions/Core looks suspicious, since it seems to return a promise that we never get hold of.

That might be very difficult to fix, since it would require tweaking upstream code.

Looking forward to hearing from you 👨🏻‍💻

from composer-install.

clxmstaab avatar clxmstaab commented on May 27, 2024

we are also running in spurious errors which look like race-conditions to me. any progress on this front?

from composer-install.

ramsey avatar ramsey commented on May 27, 2024

This is fixed in v2, please upgrade using ramsey/composer-install@v2 or ramsey/[email protected]. Details are available on the release announcement and the README.

Thanks!

from composer-install.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.