Ignore 'NonfatalArtifactCacheError' when calling the artifact cache in the background

Review Request #2624 - Created Aug. 14, 2015 and submitted

Information
Eric Ayers
pants
zundel/ignore-restful-cache-nonfatal-error
1979, 1980
9fb7a45...
Reviewers
pants-reviews
benjyw, davidt, jsirois, stuhood

This addresses some intermittent failures we were seeing from our builds with no apparent error output. We traced back the problem to a
problem with a call to the artifact cache running in the background.

Locally I'm able to reproduce this while running one of our custom tasks by turning on the artifact cache, but there is a configuration issue on my laptop that's keeping it from working.

Before:

$ ./pants clean-all test script:test --config-override=pants-ci.ini
…

12:47:25 00:03     [rspecs]
                   Bundler setup
                   Checking if bundle is installed

                   Running specs
                   Finished in 2.61 seconds (files took 0.23828 seconds to load)
                   33 examples, 0 failures
               Waiting for background workers to finish.
12:47:30 00:08   [complete]
               FAILURE

In the pants server output we could see the error:

13:19:5100:00 [background] 4.544s
13:19:5100:00 [cache] 0.406s 
Failed to HEAD https://pypi.corp.squareup.com/laundrybasket-rw/abc_BootstrapJvmTools_bootstrap_bootstrap_jvm_tools/.nailgun-server/035c2b81c6aa2b6426fb6c0224db8f578643269a-IvyResolveFingerprintStrategy_53c4bb9c6553.tgz. Error: 401 Unauthorized

After applying this fix:

13:43:48 00:04     [rspecs]
                   Bundler setup

                   Checking if bundle is installed
                   WARN] Error while inserting into artifact cache: Failed to HEAD https://pypi.corp.squareup.com/laundrybasket-rw/abc_BootstrapJvmTools_bootstrap_bootstrap_jvm_tools/.nailgun-server/035c2b81c6aa2b6426fb6c0224db8f578643269a-IvyResolveFingerprintStrategy_53c4bb9c6553.tgz. Error: 401 Unauthorized

                   Running specs
                   Finished in 2.9 seconds (files took 0.21919 seconds to load)
                   33 examples, 0 failures
               Waiting for background workers to finish.
13:43:53 00:09   [complete]
               SUCCESS
John Sirois
Benjy Weinberger
Eric Ayers
Review request changed

Status: Closed (submitted)

Change Summary:

Thanks John & Benjy. commit 8d36546

Loading...