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

Support customization of spanner host/port #200

Open
elefeint opened this issue Jan 8, 2020 · 3 comments
Open

Support customization of spanner host/port #200

elefeint opened this issue Jan 8, 2020 · 3 comments
Labels
feature New functionality P4 V2
Milestone

Comments

@elefeint
Copy link
Contributor

elefeint commented Jan 8, 2020

When Cloud Spanner emulator is available, users will need a way to specify the local connection host/port.

SpannerConnectionConfiguration is a natural place for it -- right now it parses project/instance/database information out of a fully qualified connection string, but it could as easily get host/port information to be passed to GrpcClient.
We'd also need a couple of configurable options for this, and GrpcClient needs to stop treating them as constants.

@elefeint
Copy link
Contributor Author

This is likely obsolete due to V2 redesign -- V2 is based on the client library, which acquires emulator host/port based on environment variable.

But this behavior needs to be verified.

@elefeint elefeint added feature New functionality P4 and removed P1 labels Oct 6, 2020
@elefeint
Copy link
Contributor Author

elefeint commented Oct 6, 2020

Will re-test.

@elefeint elefeint self-assigned this Oct 6, 2020
@elefeint
Copy link
Contributor Author

elefeint commented Oct 9, 2020

Verified that simply testing SPANNER_EMULATOR_HOST=localhost:9010 is sufficient to run R2DBC v2 driver against the emulator.
In the process, found a small issue with bindNull() TCK test re-implementation -- it was starting a transaction but not committing it (the superclass bindNull() is meant to run in autocommit mode, so it does not need to start a new transaction at all, so it's a problem with our override). But this is moot, since this test override will go away after #270 is merged.

But! Even though the test issue is moot, it exposed what I thought was a problem with not cleaning up the transaction manager in the driver (#279), but is likely a missed bit of clean up code in the new asynchronous transaction manager in the client library (googleapis/java-spanner#504).

I am also thinking that even though the environment variable unblocks the use of emulator, we should still provide ability to customize host/port through connection properties (both connection URL string like the JDBC driver does and the programmatically constracted SpannerConnectionConfiguration. To do this, customize SpannerClientLibraryConnectionFactory constructor to set SpannerOptions.newBuilder().setEmulatorHostPort().

@elefeint elefeint added this to the 0.4.0 milestone Nov 24, 2020
@elefeint elefeint modified the milestones: 0.5.0, 0.6.0 May 12, 2021
@JoeWang1127 JoeWang1127 assigned JoeWang1127 and unassigned elefeint Aug 4, 2022
@JoeWang1127 JoeWang1127 removed their assignment Oct 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New functionality P4 V2
Projects
None yet
Development

No branches or pull requests

2 participants