Skip to content
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

Runtime: Pass instanceID to drivers.Open for use in telemetry #4633

Merged
merged 2 commits into from
Apr 17, 2024

Conversation

begelundmuller
Copy link
Contributor

Refactors the drivers.Open function signature:

// New
Open(instanceID string, config map[string]any, client *activity.Client, logger *zap.Logger) (Handle, error)

// Previous
Open(config map[string]any, shared bool, client *activity.Client, logger *zap.Logger) (Handle, error)

The shared bool args is replaced by a convention that a connection is considered shared if instanceID == "" (this is clarified in docstrings throughout the PR).

This change enables capturing the instanceID when a connection is opened (e.g. for use in telemetry). Previously, it had to be captured in the connection's As... functions (as added in this PR), which is prone to race conditions, which are currently causing race tests to fail on main (example).

@begelundmuller begelundmuller self-assigned this Apr 17, 2024
@begelundmuller begelundmuller changed the title Runtime: Pass instanceID to drivers.Open Runtime: Pass instanceID to drivers.Open for use in telemetry Apr 17, 2024
@pjain1 pjain1 merged commit 3e73c53 into main Apr 17, 2024
4 checks passed
@pjain1 pjain1 deleted the begelundmuller/fix-as-olap-race-condition branch April 17, 2024 11:30
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.

2 participants