GeezerVison is showing github.com — Fix Spanner integration tests · Issue #1702 · googleapis/google-cloud-java
Fix Spanner integration tests #1702DescriptionSpanner integration tests are failing frequently:
https://travis-ci.org/GoogleCloudPlatform/google-cloud-java/jobs/207562209
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 2.122 sec <<< FAILURE! - in com.google.cloud.spanner.it.ITLargeReadTest
com.google.cloud.spanner.it.ITLargeReadTest Time elapsed: 0.01 sec <<< ERROR!
com.google.cloud.spanner.SpannerException: NOT_FOUND: io.grpc.StatusRuntimeException: NOT_FOUND: Database has been deleted
at com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:476)
at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:455)
at com.google.cloud.spanner.spi.DefaultSpannerRpc.get(DefaultSpannerRpc.java:398)
at com.google.cloud.spanner.spi.DefaultSpannerRpc.commit(DefaultSpannerRpc.java:376)
at com.google.cloud.spanner.SpannerImpl$TransactionContextImpl$1.call(SpannerImpl.java:1235)
at com.google.cloud.spanner.SpannerImpl$TransactionContextImpl$1.call(SpannerImpl.java:1232)
at com.google.cloud.spanner.SpannerImpl.runWithRetries(SpannerImpl.java:198)
at com.google.cloud.spanner.SpannerImpl$TransactionContextImpl.commit(SpannerImpl.java:1230)
at com.google.cloud.spanner.SpannerImpl$TransactionRunnerImpl.run(SpannerImpl.java:1148)
at com.google.cloud.spanner.SpannerImpl$SessionImpl.write(SpannerImpl.java:704)
at com.google.cloud.spanner.SessionPool$PooledSession.write(SessionPool.java:201)
at com.google.cloud.spanner.DatabaseClientImpl.write(DatabaseClientImpl.java:31)
at com.google.cloud.spanner.it.ITLargeReadTest.setUpDatabase(ITLargeReadTest.java:111)
Caused by: io.grpc.StatusRuntimeException: NOT_FOUND: Database has been deleted
at io.grpc.Status.asRuntimeException(Status.java:545)
at io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:442)
at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:56)
at com.google.cloud.spanner.spi.SpannerErrorInterceptor$1$1.onClose(SpannerErrorInterceptor.java:100)
at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:56)
at com.google.cloud.spanner.spi.WatchdogInterceptor$MonitoredCall$1.onClose(WatchdogInterceptor.java:190)
at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:56)
at com.google.cloud.spanner.GceTestEnvConfig$GrpcErrorInjector$1$1.onClose(GceTestEnvConfig.java:119)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.close(ClientCallImpl.java:481)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.access$600(ClientCallImpl.java:398)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:513)
at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:52)
at io.grpc.internal.SerializingExecutor$TaskRunner.run(SerializingExecutor.java:154)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Activitytomayles commented on Mar 7, 2017 It looks like there are multiple concurrent runs using the same instance, and they are tripping over each other. Could that be the case?
If so, we either need to update the test code to make database names unique to a run, or update the test runner to use separate instances. garrettjonesgoogle commented on Mar 7, 2017 ContributorAuthor More actions The test code has randomization built in so that the database names are unique. It might be possible that there is at least one test where the randomization isn't working, or it might be possible that there is another type of entity that needs randomization. tomayles commented on Mar 7, 2017 OK. If you look in the activity log for the project that runs these tests, you should be able to see what user/process deleted the database, which could be helpful for debugging. vkedia commented on Mar 9, 2017 mgoddard-pivotal commented on Jul 12, 2017 I'm seeing a similar issue in that, if I delete a DB, then recreate it using the same name, operations on it fail with "io.grpc.StatusRuntimeException: NOT_FOUND: Database has been deleted". This is in a web app, and I'd been assuming that the single instance of SpannerOptions could be reused, but it appears that, each time the database is dropped, a new instance is required; e.g.
this.spannerOptions = SpannerOptions.newBuilder().build();
Is this expected? vkedia commented on Jul 12, 2017 Yes a new instance of SpannerOptions would need to be created. This is because the client internally maintains a session pool and that session pool is keyed against the database name. So if you give it the same database name, it will try to use the existing pool keyed against that name. But all the sessions in that pool are now invalid since the database got deleted. mgoddard-pivotal commented on Jul 12, 2017 Ok. Thanks for clarifying that for me, and so quickly!
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|