perf(ui): parallelize independent serial-await loops (bulk delete, domain children) - #30863
perf(ui): parallelize independent serial-await loops (bulk delete, domain children)#30863harsh-vador wants to merge 1 commit into
Conversation
…main children) Two loops issued one round-trip per iteration for fully independent work: - useDelete.handleDelete: bulk delete awaited deleteEntity() once per selected row. Now Promise.allSettled over all rows; failed names are collected from the rejected results by index, preserving the exact error toast. Deletes are independent entities (no shared version), so parallelizing is safe. - DomainSelectableTree: the load-selected-children effect awaited loadChildDomains(fqn) once per selected domain FQN. Now filters the FQNs that need loading, then Promise.all over them. Independent per-domain fetches. No behavior change — same requests, same results/error handling, just concurrent. 23 DomainSelectableTree tests pass; eslint clean. Left serial intentionally: suggestionsAPI resolveTask loop (comment-documented optimistic-lock constraint), cursor-paginated replays, and the export poll loop. UploadDocumentModal's serial upload is deferred — it has cancel-mid-batch semantics and needs a bounded concurrency pool, not naive Promise.all. Ref: open-metadata/openmetadata-collate#5442 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
Code Review ✅ ApprovedParallelizes independent serial-await loops in bulk delete and domain children using Promise.all and Promise.allSettled to eliminate request waterfalls. No issues found. OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar | Powered by Gitar — free for open source |
|
|
✅ Playwright Results — workflow succeededValidated commit ✅ 550 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 3 skipped · 🧰 0 lifecycle flaky PerformanceBlocking targets: ✅ met · Optimization targets: 🟡 in progress Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting. 🕒 Full workflow signal wall (to summary) 52m 26s ⏱️ Max setup 2m 50s · max shard execution 18m 10s · max shard-job elapsed before upload 21m 15s · reporting 3s 🌐 201.25 requests/attempt · 2.83 app boots/UI scenario · 5.41% common-shard skew Optimization targets still in progress:
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |



Fixes 5445
Description
Two loops issued one round-trip per iteration for fully independent work:
useDelete.handleDelete— bulk delete awaiteddeleteEntity()once per selected row. NowPromise.allSettledover all rows; failed entity names are collected from the rejected results by index, preserving the exact error toast. Deletes target independent entities (no shared version), so parallelizing is safe.DomainSelectableTree— the load-selected-children effect awaitedloadChildDomains(fqn)once per selected domain FQN. Now filters the FQNs that need loading, thenPromise.allover them.No behavior change — same requests, same results and error handling, just concurrent.
Left serial intentionally (verified)
suggestionsAPIresolveTaskloop — comment-documented optimistic-lock constraintuseLearningResources,useColumnGridListingData), ontology depth-walk, export poll loop — inherently serialDashboardChartTable/KnowledgePageListRightPanel— alreadyPromise.allDeferred
UploadDocumentModal's serial upload has cancel-mid-batch semantics and needs a bounded concurrency pool (not naivePromise.all, which would break cancellation and could storm the server). Separate careful PR.Type of change
Tests
eslint0 errors, prettier cleanyarn test— 23 DomainSelectableTree tests pass;useDeletehas no colocated test (behavior-preserving refactor)Ref: open-metadata/openmetadata-collate#5442