querysub 0.449.0 → 0.450.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -23,6 +23,12 @@ export const archives = lazy(() => wrapArchivesWithCache(getArchives("path-value
|
|
|
23
23
|
export const archivesLocks = lazy(() => getArchives("path-values-locks/"));
|
|
24
24
|
export const archivesRecycleBin = lazy(() => wrapArchivesWithCache(getArchives("path-values-recycle-bin/")));
|
|
25
25
|
|
|
26
|
+
// Backblaze's getInfo (listFileNames) can transiently report a just-written file as missing.
|
|
27
|
+
// Before treating a missing file as a fatal "written too slowly" condition, recheck a few
|
|
28
|
+
// times to confirm it really is gone.
|
|
29
|
+
const ARCHIVE_INFO_RECHECK_ATTEMPTS = 5;
|
|
30
|
+
const ARCHIVE_INFO_RECHECK_DELAY = 5000;
|
|
31
|
+
|
|
26
32
|
export type RawValuePaths = {
|
|
27
33
|
dataPath: string;
|
|
28
34
|
values: PathValue[];
|
|
@@ -218,6 +224,12 @@ export class PathValueArchives {
|
|
|
218
224
|
let fileInfo = await archives().getInfo(fullPath);
|
|
219
225
|
// NOTE: If no fileInfo... then our file was merged? Which... is BAD, as it means we took
|
|
220
226
|
// too long to read it, so we probably took too long to write it too!
|
|
227
|
+
// Backblaze's getInfo can transiently report a just-written file as missing, so recheck
|
|
228
|
+
// a few times before treating a missing file as fatal.
|
|
229
|
+
for (let attempt = 0; !fileInfo && attempt < ARCHIVE_INFO_RECHECK_ATTEMPTS; attempt++) {
|
|
230
|
+
await delay(ARCHIVE_INFO_RECHECK_DELAY);
|
|
231
|
+
fileInfo = await archives().getInfo(fullPath);
|
|
232
|
+
}
|
|
221
233
|
if (!fileInfo || fileInfo.writeTime > slowestFileWriteTime) {
|
|
222
234
|
console.error(red(`File ${fullPath} was written too slowly, ${fileInfo?.writeTime || "undefined"} < ${slowestFileWriteTime}. This means some values will be rejected by reads. Killing server, our state is irrecoverable. Our watches have invalid data, and we have to stop before we create more invalid dependencies.`));
|
|
223
235
|
await delay(5000);
|
|
@@ -24,7 +24,7 @@ import { atomic } from "../../../2-proxy/PathValueProxyWatcher";
|
|
|
24
24
|
import { magenta } from "socket-function/src/formatting/logColors";
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
type SuppressionEntry = {
|
|
27
|
+
export type SuppressionEntry = {
|
|
28
28
|
id: string;
|
|
29
29
|
notes?: string;
|
|
30
30
|
pattern: string;
|
|
@@ -35,7 +35,7 @@ type SuppressionEntry = {
|
|
|
35
35
|
createdTime: number;
|
|
36
36
|
lastUpdatedTime: number;
|
|
37
37
|
};
|
|
38
|
-
const suppression = archiveJSONT<SuppressionEntry>(() => nestArchives("logs/error-suppression/", getArchivesBackblaze(getDomain())));
|
|
38
|
+
export const suppression = archiveJSONT<SuppressionEntry>(() => nestArchives("logs/error-suppression/", getArchivesBackblaze(getDomain())));
|
|
39
39
|
let suppressionCache: SuppressionEntry[] = [];
|
|
40
40
|
|
|
41
41
|
// In-memory Discord notification throttling
|