gitnexus 1.6.9-rc.38 → 1.6.9-rc.39
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.
|
@@ -72,10 +72,13 @@ export interface LbugConnectionHandle {
|
|
|
72
72
|
conn: lbug.Connection;
|
|
73
73
|
}
|
|
74
74
|
/**
|
|
75
|
-
* Return true when the error message indicates that a LadybugDB
|
|
76
|
-
* could not
|
|
77
|
-
*
|
|
78
|
-
*
|
|
75
|
+
* Return true when the error message indicates that a LadybugDB write
|
|
76
|
+
* transaction could not proceed due to lock contention — either a file
|
|
77
|
+
* lock that could not be acquired (either at construction time,
|
|
78
|
+
* `new lbug.Database(...)` raising from `local_file_system.cpp`, or during
|
|
79
|
+
* a query, another writer holds the exclusive lock), or a same-process
|
|
80
|
+
* write transaction rejected because another write transaction is already
|
|
81
|
+
* active on the connection.
|
|
79
82
|
*
|
|
80
83
|
* Lives here (not in `lbug-adapter.ts`) so both the construction-time
|
|
81
84
|
* retry (`openWithLockRetry` in this file) and the query-time retry
|
|
@@ -338,10 +338,13 @@ export const isLbugCheckpointIoError = (err) => {
|
|
|
338
338
|
return LBUG_CHECKPOINT_PERMISSIVE_RE.test(msg);
|
|
339
339
|
};
|
|
340
340
|
/**
|
|
341
|
-
* Return true when the error message indicates that a LadybugDB
|
|
342
|
-
* could not
|
|
343
|
-
*
|
|
344
|
-
*
|
|
341
|
+
* Return true when the error message indicates that a LadybugDB write
|
|
342
|
+
* transaction could not proceed due to lock contention — either a file
|
|
343
|
+
* lock that could not be acquired (either at construction time,
|
|
344
|
+
* `new lbug.Database(...)` raising from `local_file_system.cpp`, or during
|
|
345
|
+
* a query, another writer holds the exclusive lock), or a same-process
|
|
346
|
+
* write transaction rejected because another write transaction is already
|
|
347
|
+
* active on the connection.
|
|
345
348
|
*
|
|
346
349
|
* Lives here (not in `lbug-adapter.ts`) so both the construction-time
|
|
347
350
|
* retry (`openWithLockRetry` in this file) and the query-time retry
|
|
@@ -353,10 +356,19 @@ export const isDbBusyError = (err) => {
|
|
|
353
356
|
// `lock` already subsumes `could not set lock`; the broader term is kept
|
|
354
357
|
// because graph-DB transient errors include "deadlock", "lock contention",
|
|
355
358
|
// and the LadybugDB native module's "could not set lock on file" — all of
|
|
356
|
-
// which deserve a retry.
|
|
357
|
-
//
|
|
358
|
-
//
|
|
359
|
-
|
|
359
|
+
// which deserve a retry. LadybugDB also reports same-process writer
|
|
360
|
+
// contention without the words "busy" or "lock".
|
|
361
|
+
//
|
|
362
|
+
// "only one write transaction at a time" was observed against LadybugDB
|
|
363
|
+
// 0.18.0 (see gitnexus/package.json @ladybugdb/core).
|
|
364
|
+
//
|
|
365
|
+
// If a non-transient lock-shaped error ever surfaces (e.g., "lock file
|
|
366
|
+
// missing" during recovery), tighten this matcher rather than raising the
|
|
367
|
+
// retry budget.
|
|
368
|
+
return (msg.includes('busy') ||
|
|
369
|
+
msg.includes('lock') ||
|
|
370
|
+
msg.includes('already in use') ||
|
|
371
|
+
msg.includes('only one write transaction at a time'));
|
|
360
372
|
};
|
|
361
373
|
export function createLbugDatabase(lbugModule, databasePath, options = {}) {
|
|
362
374
|
// .d.ts declares fewer args than the native constructor accepts.
|
package/package.json
CHANGED