Jerome ng/2072 cdm creation fails in manual test#2736
Open
jerome-ng wants to merge 10 commits into
Open
Conversation
…nalytics connection logic
jerome-ng
commented
Jul 7, 2026
|
|
||
| const sendCDWServiceError = (res, action) => { | ||
| if ( | ||
| action === "column_suggestion_service" || |
Collaborator
Author
There was a problem hiding this comment.
Preserving existing behaviour
jerome-ng
commented
Jul 7, 2026
| isTestEnvironment, | ||
| ); | ||
|
|
||
| if (req.query.action === "attributeType_service") { |
Collaborator
Author
There was a problem hiding this comment.
Early return as this action does not need analytics service
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses multiple CDM config creation/editing failures found during manual testing by improving connection lifecycle management around Trex/analytics metadata operations, hardening blank-config defaults, and stabilizing CDW suggestion behavior under cold-start concurrency.
Changes:
- Close analytics/Trex connections after metadata-oriented operations (e.g., validation/autosave/activate/getColumns and CDW service calls).
- Update blank config defaults to derive credentials from the CDW-tagged service in
VCAP_SERVICES(instead of the old analytics tag lookup). - Preserve suggestion endpoint response shape by returning
{ data: [] }on column/table suggestion failures, and add a per-destination attach guard for Trex connections.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| plugins/functions/cdw-svc/src/utils/trexConnection.ts | Adds a per-destination locking/ready mechanism intended to serialize cold-start Trex attach/setup. |
| plugins/functions/cdw-svc/src/qe/settings/SettingsFacade.ts | Ensures analytics connection cleanup after getColumns metadata calls. |
| plugins/functions/cdw-svc/src/qe/config/configSuggestion.ts | Introduces getCdwServiceCredentials() and uses it to seed blank config defaults. |
| plugins/functions/cdw-svc/src/qe/config/ConfigFacade.ts | Centralizes analytics connection cleanup for several actions that open analytics connections. |
| plugins/functions/cdw-svc/src/main.ts | Closes analytics connections after CDW service requests; returns { data: [] } for suggestion-service failures; avoids analytics connection for attributeType_service. |
| plugins/functions/cdw-svc/spec/qe/config/suggestion_test.ts | Adds unit coverage for selecting the first CDW-tagged service when multiple exist. |
…oper connection handling
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes several CDM config creation/editing failures found during manual testing. The changes focus on making CDW/Trex metadata calls safer, cleaning up opened connections, and avoiding cold-start attach races during config suggestions.
What Changed
attributeType_service, which only needs config metadata.{ "data": [] }for column/table suggestion failures.getConnection()is serialized, then later requests use the normal fast path.Why
Manual testing exposed multiple related failure modes:
configDefaultscould fail withFound 0 matching serviceswhen looking up the oldanalyticstag.validation_schema already exists.Validation
column_suggestion_servicerequests at concurrency 10 plus a successful follow-up request.validation_schema already exists,Failed to attach database,UncaughtException,event loop error, or request timeout errors during the final benchmark run.CDM creationmanual test locally.