I'm busy testing gRPC support with the PubSub API.
I have the following dependencies installed:
This is on PHP 7.0.11.
I'm testing a pull type subscription and keep getting "Deadline Exceeded" exceptions on a timeout.
Fatal error: Uncaught Google\Cloud\Exception\ServiceException: Deadline Exceeded in /opt/php-pubsub/vendor/google/cloud/src/GrpcRequestWrapper.php:188
Stack trace:
#0 /opt/php-pubsub/vendor/google/cloud/src/GrpcRequestWrapper.php(131): Google\Cloud\GrpcRequestWrapper->convertToGoogleException(Object(Google\GAX\ApiException))
#1 /opt/php-pubsub/vendor/google/cloud/src/GrpcTrait.php(63): Google\Cloud\GrpcRequestWrapper->send(Array, Array, Array)
#2 /opt/php-pubsub/vendor/google/cloud/src/PubSub/Connection/Grpc.php(227): Google\Cloud\PubSub\Connection\Grpc->send(Array, Array)
#3 /opt/php-pubsub/vendor/google/cloud/src/PubSub/Subscription.php(356): Google\Cloud\PubSub\Connection\Grpc->pull(Array)
#4 /opt/php-pubsub/src/GoogleCloudPubSubAdapter.php(141): Google\Cloud\PubSub\Subscription->pull()
#5 /opt/php-pubsub/examples/GoogleCloudConsumerExample.php(15): Superbalist\PubSub\GoogleCloud\GoogleCloudPubSubAdapter->subscribe('my_channel', Object(Closure))
#6 {main}
thrown in /opt/php-pubsub/vendor/google/cloud/src/GrpcRequestWrapper.php on line 188
Is there an option I need to pass for setting the correct timeout?
Can you share the code you're running that is raising this error?
ye sure
It's the superbalist/php-pubsub-google-cloud adapter we maintain - https://github.com/Superbalist/php-pubsub-google-cloud
I've pushed latest changes to master in this commit - https://github.com/Superbalist/php-pubsub-google-cloud/commit/ed1c5203c3fc894e5a3d4c65db9a9f472e6a6668
We have a dockerfile with examples for testing.
make upphp examples/GoogleCloudConsumerExample.phpIf the consumer runs for long enough without receiving a message, the ServiceException is thrown.
Hey @matthewgoslett! Apologies for the delay in a response here.
I spent some time looking into this, and it appears that a default timeout of 60 seconds is being applied to pull calls which are run through gRPC.
You can override this default setting like so:
$messages = $subscription->pull([
'grpcOptions' => [
'timeoutMillis' => null
]
]);
Please let me know if that helps solve the issue for you. :)
I'm going to close this out for now, please feel free to re-open if there are any other concerns.
Most helpful comment
Hey @matthewgoslett! Apologies for the delay in a response here.
I spent some time looking into this, and it appears that a default timeout of 60 seconds is being applied to pull calls which are run through gRPC.
https://github.com/GoogleCloudPlatform/google-cloud-php/blob/master/src/PubSub/V1/resources/subscriber_client_config.json#L70
You can override this default setting like so:
Please let me know if that helps solve the issue for you. :)