Spaces:
Running

fsanyoto commited on
Commit
3df8d29
·
verified ·
1 Parent(s): 0d534a1

Deploy AIOS web (React glide grid + FastAPI slice)

Browse files
RELEASES.json CHANGED
@@ -1,4 +1,4 @@
1
  {
2
- "current": "d6c7d76731",
3
  "releases": []
4
  }
 
1
  {
2
+ "current": "0760473a8c",
3
  "releases": []
4
  }
VERSION CHANGED
@@ -1 +1 @@
1
- d6c7d76731
 
1
+ 0760473a8c
api/main.py CHANGED
@@ -1085,6 +1085,11 @@ def _publish_connector_status(rt, provider, outcome=None, *, detail="", connecti
1085
  held["rows"] = int(cur.execute(f'SELECT count(*) FROM "{table}"').fetchone()[0])
1086
  except Exception:
1087
  held["rows"] = None
 
 
 
 
 
1088
  except Exception:
1089
  for held in extra["held"].values():
1090
  held["rows"] = None
 
1085
  held["rows"] = int(cur.execute(f'SELECT count(*) FROM "{table}"').fetchone()[0])
1086
  except Exception:
1087
  held["rows"] = None
1088
+ try:
1089
+ # A table the pass did not reach names its stored refusal, as Table syncs does.
1090
+ _held_copy.amazon_held_stored_causes(cur, extra["held"])
1091
+ except Exception as exc: # noqa: BLE001
1092
+ print(f"[aios-api] held causes kept as written ({type(exc).__name__})", flush=True)
1093
  except Exception:
1094
  for held in extra["held"].values():
1095
  held["rows"] = None
api/routes_connectors.py CHANGED
@@ -3220,6 +3220,42 @@ def amazon_hold_cause(row=None, held="", *, table=""):
3220
  return _amazon_cause_text(cause)
3221
 
3222
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3223
  def amazon_held_entries(report, holds, now=None):
3224
  """The status document's per-table held entries: the cause, the kept rows sentence, and any retry time."""
3225
  from datetime import timedelta
 
3220
  return _amazon_cause_text(cause)
3221
 
3222
 
3223
+ #: The cause a held table gets when the last pass had no row for it.
3224
+ AMAZON_NOT_REACHED = "This pass ended before this table's turn."
3225
+
3226
+
3227
+ def amazon_held_stored_causes(cur, entries):
3228
+ """Name each not-reached held table's stored refusal or throttle, read from the tenant mirror's markers.
3229
+
3230
+ The pass candidate holds only the due tables' markers, so the tenant mirror is the one place a not-due
3231
+ table's last refusal is readable, as Table syncs reads it."""
3232
+ from harness import amazon_store as az
3233
+ for name, entry in (entries or {}).items():
3234
+ if not str(entry.get("cause") or "").startswith(AMAZON_NOT_REACHED):
3235
+ continue
3236
+ keys = (az.entity_key(name), az.entity_key("refused_" + name))
3237
+ rows = cur.execute("SELECT entity, phase, cursor_wd FROM _sync_state WHERE entity IN (?, ?) "
3238
+ "OR ends_with(entity, ?) OR ends_with(entity, ?)",
3239
+ [*keys, "__" + keys[0], "__" + keys[1]]).fetchall()
3240
+ marks, refusals = {}, {}
3241
+ for entity, phase, detail in rows:
3242
+ prefix, _sep, key = str(entity).rpartition("__")
3243
+ (refusals if key == keys[1] or entity == keys[1] else marks)[prefix] = (phase, detail)
3244
+ for prefix, (phase, detail) in sorted(marks.items()):
3245
+ if phase not in ("refused", "failed", "throttled"):
3246
+ continue
3247
+ try:
3248
+ saved = json.loads((refusals.get(prefix) or (None, None))[1] or "{}")
3249
+ except (ValueError, TypeError):
3250
+ saved = {}
3251
+ saved = saved if isinstance(saved, dict) else {}
3252
+ cause = amazon_hold_cause({"state": phase, "amazonStatus": saved.get("amazonStatus") or "",
3253
+ "reason": saved.get("reason") or detail or ""}, table=name)
3254
+ entry.update(cause=cause, reason=f"{cause} {AMAZON_HELD_KEPT}")
3255
+ break
3256
+ return entries
3257
+
3258
+
3259
  def amazon_held_entries(report, holds, now=None):
3260
  """The status document's per-table held entries: the cause, the kept rows sentence, and any retry time."""
3261
  from datetime import timedelta
web/public/AIOS_DEPLOY_RECEIPT CHANGED
@@ -1 +1 @@
1
- dd03de20c9d9311157d8a7045970facaa289d7f8bce35267d5cce5351e3e2777
 
1
+ 21ede243d30191f67fdabc0ee2bd7c6f68680fba9346d71c1628977eb842a7a2