diff options
| author | y75zhang <yang-mark.zhang@nokia-sbell.com> | 2024-07-03 08:20:34 +0300 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-07-04 22:56:41 +0100 |
| commit | 4172c3bdd5a076da6bb125071a8157a0fef28932 (patch) | |
| tree | 11e1e195e3e10078b0758e463bf9064b8a99dc06 /bitbake/lib/bb | |
| parent | 72a9b812c907ca64ae81f6f923aad967536aea25 (diff) | |
| download | poky-4172c3bdd5a076da6bb125071a8157a0fef28932.tar.gz | |
bitbake: fetch/wget: checkstatus: drop shared connecton when catch Timeout error
* to avoid wrong http response in checkstatus function:
in wget checkstatus() we are using 'HTTPConnectionCache' to share connections
1. state_file1(exists on http server) use shared connection <shared1> to send request
2. http_server recieved request of state_file1, but delayed by some reason to sent respone
3. state_file1 checkstatus() failed by timeout and drop shared connection <shared1>
4. state_file2(not exists on http server) get shared connection <shared1> and send request
5. http_server finally send 200 response for state_file1
6. state_file2 recived 200 response and thought it was exists on http_server
(Bitbake rev: bf6d0282ab88b4edc4b9e58184cd76cce965abbd)
Signed-off-by: y75zhang <yang-mark.zhang@nokia-sbell.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb')
| -rw-r--r-- | bitbake/lib/bb/fetch2/wget.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/bitbake/lib/bb/fetch2/wget.py b/bitbake/lib/bb/fetch2/wget.py index 2e92117634..e8b1292433 100644 --- a/bitbake/lib/bb/fetch2/wget.py +++ b/bitbake/lib/bb/fetch2/wget.py | |||
| @@ -244,7 +244,12 @@ class Wget(FetchMethod): | |||
| 244 | fetch.connection_cache.remove_connection(h.host, h.port) | 244 | fetch.connection_cache.remove_connection(h.host, h.port) |
| 245 | raise urllib.error.URLError(err) | 245 | raise urllib.error.URLError(err) |
| 246 | else: | 246 | else: |
| 247 | r = h.getresponse() | 247 | try: |
| 248 | r = h.getresponse() | ||
| 249 | except TimeoutError as e: | ||
| 250 | if fetch.connection_cache: | ||
| 251 | fetch.connection_cache.remove_connection(h.host, h.port) | ||
| 252 | raise TimeoutError(e) | ||
| 248 | 253 | ||
| 249 | # Pick apart the HTTPResponse object to get the addinfourl | 254 | # Pick apart the HTTPResponse object to get the addinfourl |
| 250 | # object initialized properly. | 255 | # object initialized properly. |
