Spaces:
Running
Running
refactor(deploy): make TML import async-only (remove flag + sync branches)
Browse filesBoth table phases now call import_tmls_async directly — no TS_TML_IMPORT_MODE
flag, no sync path selection. The old sync closures (_import_tml_chunk,
_import_tmls_chunked, _resolve_/_verify_*_after_timeout) are now unreferenced
dead code; they'll be excised in a follow-up once one async build is validated
end-to-end (kept in git history as the fallback). Shared deploy_all → app + MCP.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- thoughtspot_deployer.py +10 -34
thoughtspot_deployer.py
CHANGED
|
@@ -2665,11 +2665,6 @@ class ThoughtSpotDeployer:
|
|
| 2665 |
|
| 2666 |
_slog = session_logger
|
| 2667 |
_ts_error = None
|
| 2668 |
-
# Async TML import (reliability fix for gateway 504s) — opt-in via env,
|
| 2669 |
-
# default sync so behavior is unchanged until the flag is flipped.
|
| 2670 |
-
use_async = os.getenv("TS_TML_IMPORT_MODE", "sync").strip().lower() == "async"
|
| 2671 |
-
if use_async:
|
| 2672 |
-
log_progress(" [async] TS_TML_IMPORT_MODE=async — async TML import enabled")
|
| 2673 |
|
| 2674 |
try:
|
| 2675 |
import time
|
|
@@ -3410,20 +3405,11 @@ class ThoughtSpotDeployer:
|
|
| 3410 |
f" Sending table creation requests for {len(table_tmls_batch1)} tables "
|
| 3411 |
f"(chunk size {create_chunk_size})..."
|
| 3412 |
)
|
| 3413 |
-
|
| 3414 |
-
|
| 3415 |
-
|
| 3416 |
-
|
| 3417 |
-
|
| 3418 |
-
)
|
| 3419 |
-
else:
|
| 3420 |
-
objects = _import_tmls_chunked(
|
| 3421 |
-
"Batch 1",
|
| 3422 |
-
table_names_order,
|
| 3423 |
-
table_tmls_batch1,
|
| 3424 |
-
create_new=True,
|
| 3425 |
-
chunk_size=create_chunk_size,
|
| 3426 |
-
)
|
| 3427 |
|
| 3428 |
if objects is None:
|
| 3429 |
return results
|
|
@@ -3532,21 +3518,11 @@ class ThoughtSpotDeployer:
|
|
| 3532 |
f" Sending join update requests for {len(table_tmls_batch2)} tables "
|
| 3533 |
f"(chunk size {update_chunk_size})..."
|
| 3534 |
)
|
| 3535 |
-
|
| 3536 |
-
|
| 3537 |
-
|
| 3538 |
-
|
| 3539 |
-
|
| 3540 |
-
)
|
| 3541 |
-
else:
|
| 3542 |
-
objects = _import_tmls_chunked(
|
| 3543 |
-
"Batch 2",
|
| 3544 |
-
table_names_order_batch2,
|
| 3545 |
-
table_tmls_batch2,
|
| 3546 |
-
create_new=False,
|
| 3547 |
-
chunk_size=update_chunk_size,
|
| 3548 |
-
fatal_errors=False,
|
| 3549 |
-
)
|
| 3550 |
|
| 3551 |
if objects is not None:
|
| 3552 |
# Process each result by table name. Partial retry recovery can
|
|
|
|
| 2665 |
|
| 2666 |
_slog = session_logger
|
| 2667 |
_ts_error = None
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2668 |
|
| 2669 |
try:
|
| 2670 |
import time
|
|
|
|
| 3405 |
f" Sending table creation requests for {len(table_tmls_batch1)} tables "
|
| 3406 |
f"(chunk size {create_chunk_size})..."
|
| 3407 |
)
|
| 3408 |
+
objects = self.import_tmls_async(
|
| 3409 |
+
table_names_order, table_tmls_batch1, True,
|
| 3410 |
+
connection_guid, connection_name,
|
| 3411 |
+
log_progress=log_progress, slog=_slog,
|
| 3412 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3413 |
|
| 3414 |
if objects is None:
|
| 3415 |
return results
|
|
|
|
| 3518 |
f" Sending join update requests for {len(table_tmls_batch2)} tables "
|
| 3519 |
f"(chunk size {update_chunk_size})..."
|
| 3520 |
)
|
| 3521 |
+
objects = self.import_tmls_async(
|
| 3522 |
+
table_names_order_batch2, table_tmls_batch2, False,
|
| 3523 |
+
connection_guid, connection_name,
|
| 3524 |
+
log_progress=log_progress, slog=_slog,
|
| 3525 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3526 |
|
| 3527 |
if objects is not None:
|
| 3528 |
# Process each result by table name. Partial retry recovery can
|