Compare commits

...
2 Commits
Author SHA1 Message Date
Glavo ab6e8692ad 修复缓存异常时 FetchTask 无限循环的问题 (#4844) 2025-11-23 15:20:14 +08:00
辞庐 97ada51489 更新 amdgpu.ids (#4845) 2025-11-23 15:15:37 +08:00
3 changed files with 19 additions and 7 deletions

No files matched your search

@@ -112,7 +112,7 @@ public final class UpdateChecker {
try {
result = checkUpdate(channel, preview);
LOG.info("Latest version (" + channel + ", preview=" + preview + ") is " + result);
} catch (IOException e) {
} catch (Throwable e) {
LOG.warning("Failed to check for update", e);
}
@@ -187,7 +187,9 @@ public abstract class FetchTask<T> extends Task<T> {
ArrayList<IOException> exceptions = null;
for (int retryTime = 0; retryTime < retry; retryTime++) {
// If loading the cache fails, the cache should not be loaded again.
boolean useCachedResult = true;
for (int retryTime = 0, retryLimit = retry; retryTime < retryLimit; retryTime++) {
if (isCancelled()) {
throw new InterruptedException();
}
@@ -204,7 +206,7 @@ public abstract class FetchTask<T> extends Task<T> {
LinkedHashMap<String, String> headers = new LinkedHashMap<>();
headers.put("accept-encoding", "gzip");
if (checkETag)
if (useCachedResult && checkETag)
headers.putAll(repository.injectConnection(uri));
do {
@@ -248,7 +250,7 @@ public abstract class FetchTask<T> extends Task<T> {
} while (true);
int responseCode = response.statusCode();
if (responseCode == HttpURLConnection.HTTP_NOT_MODIFIED) {
if (useCachedResult && responseCode == HttpURLConnection.HTTP_NOT_MODIFIED) {
// Handle cache
try {
Path cache = repository.getCachedRemoteFile(currentURI, false);
@@ -260,9 +262,10 @@ public abstract class FetchTask<T> extends Task<T> {
} catch (IOException e) {
LOG.warning("Unable to use cached file, redownload " + NetworkUtils.dropQuery(uri), e);
repository.removeRemoteEntry(currentURI);
useCachedResult = false;
// Now we must reconnect the server since 304 may result in empty content,
// if we want to redownload the file, we must reconnect the server without etag settings.
retryTime--;
retryLimit++;
continue;
}
} else if (responseCode / 100 == 4) {
@@ -1,4 +1,4 @@
# https://gitlab.freedesktop.org/mesa/libdrm/-/blob/7d43d9b6fe5df4b234937fce9e51adb1b327ded1/data/amdgpu.ids
# https://gitlab.freedesktop.org/mesa/libdrm/-/blob/35a21916c8f621b35a67f3c5994280ae59a4981a/data/amdgpu.ids
#
# List of AMDGPU IDs
#
@@ -559,6 +559,7 @@
7448, 00, AMD Radeon Pro W7900
7449, 00, AMD Radeon Pro W7800 48GB
744A, 00, AMD Radeon Pro W7900 Dual Slot
744B, 00, AMD Radeon Pro W7900D
744C, C8, AMD Radeon RX 7900 XTX
744C, CC, AMD Radeon RX 7900 XT
744C, CE, AMD Radeon RX 7900 GRE
@@ -569,6 +570,7 @@
7470, 00, AMD Radeon Pro W7700
747E, C8, AMD Radeon RX 7800 XT
747E, D8, AMD Radeon RX 7800M
747E, DB, AMD Radeon RX 7700
747E, FF, AMD Radeon RX 7700 XT
7480, 00, AMD Radeon Pro W7600
7480, C0, AMD Radeon RX 7600 XT
@@ -586,6 +588,7 @@
74A1, 00, AMD Instinct MI300X
74A2, 00, AMD Instinct MI308X
74A5, 00, AMD Instinct MI325X
74A8, 00, AMD Instinct MI308X HF
74A9, 00, AMD Instinct MI300X HF
74B5, 00, AMD Instinct MI300X VF
74B6, 00, AMD Instinct MI308X
@@ -594,6 +597,12 @@
7550, C2, AMD Radeon RX 9070 GRE
7550, C3, AMD Radeon RX 9070
7551, C0, AMD Radeon AI PRO R9700
7590, C0, AMD Radeon RX 9060 XT
7590, C7, AMD Radeon RX 9060
75A0, C0, AMD Instinct MI350X
75A3, C0, AMD Instinct MI355X
75B0, C0, AMD Instinct MI350X VF
75B3, C0, AMD Instinct MI355X VF
9830, 00, AMD Radeon HD 8400 / R3 Series
9831, 00, AMD Radeon HD 8400E
9832, 00, AMD Radeon HD 8330
@@ -689,4 +698,4 @@
98E4, E9, AMD Radeon R4 Graphics
98E4, EA, AMD Radeon R4 Graphics
98E4, EB, AMD Radeon R3 Graphics
98E4, EB, AMD Radeon R4 Graphics
98E4, EB, AMD Radeon R4 Graphics