Skip to content

[server][controller][dvc][changelog] Avoid constructing D2Client for server, controller and clients. #1779

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

haoxu07
Copy link
Contributor

@haoxu07 haoxu07 commented May 9, 2025

Problem Statement

Previously, each component (server, controller, change_capture_client) constructed its own D2Client instance using D2Builder and passed in the necessary configurations. As the D2Client continues to evolve, it now requires additional configuration parameters, some of which are unnecessary or unavailable in test and open-source environments. To address this, we refactor the components to accept pre-constructed D2Client instances instead of constructing them internally.

This change allows the deployable layer to construct fully customized D2Clients suited to the environment and usage, improving flexibility and testability.

Affected Components:

  • Server
  • Controller
  • DaVinci Client
  • Change Capture Clients

Solution

Code changes

  • Added new code behind a config. If so list the config names and their default values in the PR description.
  • Introduced new log lines.
    • Confirmed if logs need to be rate limited to avoid excessive logging.

Concurrency-Specific Checks

Both reviewer and PR author to verify

  • Code has no race conditions or thread safety issues.
  • Proper synchronization mechanisms (e.g., synchronized, RWLock) are used where needed.
  • No blocking calls inside critical sections that could lead to deadlocks or performance degradation.
  • Verified thread-safe collections are used (e.g., ConcurrentHashMap, CopyOnWriteArrayList).
  • Validated proper exception handling in multi-threaded code to avoid silent thread termination.

How was this PR tested?

  • New unit tests added.
  • New integration tests added.
  • Modified or extended existing tests.
  • Verified backward compatibility (if applicable).

Does this PR introduce any user-facing or breaking changes?

  • No. You can skip the rest of this section.
  • Yes. Clearly explain the behavior change and its impact.

@haoxu07 haoxu07 force-pushed the passD2Client branch 7 times, most recently from 9b10fa5 to ec7cd73 Compare May 9, 2025 23:48
@haoxu07 haoxu07 force-pushed the passD2Client branch 2 times, most recently from 13008bc to 3008dcc Compare May 10, 2025 02:42
@haoxu07 haoxu07 changed the title [WIP] Avoid constructing D2Client for server and router. [server][controller][dvc][changelog] Avoid constructing D2Client for server, controller and clients. May 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant