summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch2/__init__.py
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2017-02-08 22:41:50 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-02-19 06:28:47 -0800
commitb14e61d1bd17d2976cc25fc78ccaad1c0659dd50 (patch)
tree98ded15f8c9a5d0000cb7b2bbe208d3b6152adc6 /bitbake/lib/bb/fetch2/__init__.py
parent6c611d697f9c03867c938cba1b481f38eebed8bf (diff)
downloadpoky-b14e61d1bd17d2976cc25fc78ccaad1c0659dd50.tar.gz
bitbake: fetch2: Add NFS Stale file exception handling
- In some cases the file descriptor is held by nfs client and none of os.path.* is catching that, it could mean that error is not doled out because client has cached the stat info. In this case we are out of luck. Needed to catch IOError, which would be causing the Stale error. - In download method, update_stamp is invoked md5sum validation which is found to be throwing Stale errors. - Added error handling to fix the stale errors. (Bitbake rev: 5a53e7d7b017769a6eb0f0a6335735a1fe51a5ec) Signed-off-by: Balaji Punnuru <balaji_punnuru@cable.comcast.com> Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/fetch2/__init__.py')
-rw-r--r--bitbake/lib/bb/fetch2/__init__.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py
index 8dd276fa72..70387f52db 100644
--- a/bitbake/lib/bb/fetch2/__init__.py
+++ b/bitbake/lib/bb/fetch2/__init__.py
@@ -35,6 +35,7 @@ import operator
35import collections 35import collections
36import subprocess 36import subprocess
37import pickle 37import pickle
38import errno
38import bb.persist_data, bb.utils 39import bb.persist_data, bb.utils
39import bb.checksum 40import bb.checksum
40from bb import data 41from bb import data
@@ -998,6 +999,12 @@ def try_mirror_url(fetch, origud, ud, ld, check = False):
998 except bb.fetch2.NetworkAccess: 999 except bb.fetch2.NetworkAccess:
999 raise 1000 raise
1000 1001
1002 except IOError as e:
1003 if e.errno in [os.errno.ESTALE]:
1004 logger.warn("Stale Error Observed %s." % ud.url)
1005 return False
1006 raise
1007
1001 except bb.fetch2.BBFetchException as e: 1008 except bb.fetch2.BBFetchException as e:
1002 if isinstance(e, ChecksumError): 1009 if isinstance(e, ChecksumError):
1003 logger.warning("Mirror checksum failure for url %s (original url: %s)\nCleaning and trying again." % (ud.url, origud.url)) 1010 logger.warning("Mirror checksum failure for url %s (original url: %s)\nCleaning and trying again." % (ud.url, origud.url))
@@ -1646,6 +1653,11 @@ class Fetch(object):
1646 1653
1647 update_stamp(ud, self.d) 1654 update_stamp(ud, self.d)
1648 1655
1656 except IOError as e:
1657 if e.errno in [os.errno.ESTALE]:
1658 logger.error("Stale Error Observed %s." % u)
1659 raise ChecksumError("Stale Error Detected")
1660
1649 except BBFetchException as e: 1661 except BBFetchException as e:
1650 if isinstance(e, ChecksumError): 1662 if isinstance(e, ChecksumError):
1651 logger.error("Checksum failure fetching %s" % u) 1663 logger.error("Checksum failure fetching %s" % u)