@ai-ecoverse/slicc-kernel 1.51.1 → 1.53.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/dist/node.js CHANGED
@@ -4646,6 +4646,7 @@ var DriverConnection = class _DriverConnection {
4646
4646
  // src/mount/mount-fs.ts
4647
4647
  var MAX_LINKS4 = 40;
4648
4648
  var STALE_RETRIES = 3;
4649
+ var SETTLE_ROUNDS = 4;
4649
4650
  var DEFAULT_IO = 8 * 1024 * 1024;
4650
4651
  var UNITS = { "": 1, k: 1024, m: 1024 ** 2, g: 1024 ** 3, t: 1024 ** 4 };
4651
4652
  function parseSize(text) {
@@ -4858,7 +4859,6 @@ var MountTable = class {
4858
4859
  mounts = /* @__PURE__ */ new Map();
4859
4860
  sessions = /* @__PURE__ */ new Map();
4860
4861
  committing = /* @__PURE__ */ new Map();
4861
- epoch = 0;
4862
4862
  devices = 0;
4863
4863
  pending = /* @__PURE__ */ new Set();
4864
4864
  notes = /* @__PURE__ */ new Map();
@@ -4964,6 +4964,7 @@ var MountTable = class {
4964
4964
  maxFile: maxFile ?? caps.maxFile ?? 0,
4965
4965
  attrs: /* @__PURE__ */ new Map(),
4966
4966
  lists: /* @__PURE__ */ new Map(),
4967
+ epoch: 0,
4967
4968
  dispose: () => opened2.dispose(),
4968
4969
  ...opened2.present ? { present: opened2.present } : {}
4969
4970
  };
@@ -5018,7 +5019,7 @@ var MountTable = class {
5018
5019
  const session = this.sessions.get(real);
5019
5020
  if (!session) return this.committing.get(real)?.done;
5020
5021
  this.sessions.delete(real);
5021
- this.epoch++;
5022
+ session.mount.epoch++;
5022
5023
  const done4 = (async () => {
5023
5024
  try {
5024
5025
  await session.mount.conn.call({ op: "release", fh: await session.fh });
@@ -5071,23 +5072,24 @@ var MountTable = class {
5071
5072
  this.deps.changed?.(...full);
5072
5073
  }
5073
5074
  forget(mount, path) {
5074
- this.epoch++;
5075
+ mount.epoch++;
5075
5076
  for (const key of [...mount.attrs.keys()]) if (within3(key, path)) mount.attrs.delete(key);
5076
5077
  mount.lists.delete(path);
5077
5078
  mount.lists.delete(parentOf5(path));
5078
5079
  for (const key of [...mount.lists.keys()]) if (within3(key, path)) mount.lists.delete(key);
5079
5080
  }
5080
5081
  async getattr(mount, path, rel2, settled = false) {
5081
- for (; ; ) {
5082
+ for (let round = 1; ; round++) {
5082
5083
  if (mount.conn.failure) throw mount.conn.failure;
5083
5084
  if (settled) await this.committing.get(path)?.done.catch(() => void 0);
5084
5085
  const cached = mount.attrs.get(path);
5085
5086
  if (cached && cached.expires > Date.now()) return cached.value;
5086
- const seen = this.epoch;
5087
+ const seen = mount.epoch;
5087
5088
  const session = this.sessions.get(path);
5088
5089
  const attr = await mount.conn.call({ op: "getattr", path: rel2 });
5089
- if (this.epoch !== seen) {
5090
- if (settled && (this.sessions.get(path) !== session || this.committing.has(path))) continue;
5090
+ if (mount.epoch !== seen) {
5091
+ const moved2 = this.sessions.get(path) !== session || this.committing.has(path);
5092
+ if (settled && moved2 && round < SETTLE_ROUNDS) continue;
5091
5093
  return attr;
5092
5094
  }
5093
5095
  const ttl = mount.caps.attrTtl ?? 1e3;
@@ -10513,6 +10515,7 @@ function replayingHops(inner, heldMs = HELD_MS) {
10513
10515
  clearTimeout(waiting.timer);
10514
10516
  return replay(waiting);
10515
10517
  }
10518
+ if (waiting) drop(key);
10516
10519
  const response = await inner.fetch(request);
10517
10520
  if (!response.redirects?.length) return response;
10518
10521
  return replay({