Skip to content

Auto reestablish StreamingPull connection after retryable error events #448

@adrianodennanni

Description

@adrianodennanni

Environment details

  • OS: Debian GNU/Linux 8 (jessie)
  • Node.js version: v10.11.0
  • npm version: 6.4.1
  • @google-cloud/pubsub version: 0.20.1

Steps to reproduce

  1. Create a StreamingPull listener:
request = {
  subscription: formattedSubscription,
  streamAckDeadlineSeconds: 60
};

stream = subscriberClient.streamingPull();

stream.on('data', response => {
  console.log(response);
});

stream.on('error', error => {
  console.error(error);
});

// Write request objects.
stream.write(request);
  1. Works fine for few minutes until the server becomes UNAVAILABE (error 14, code 8a75). After that, the stream stops receiving events.

I know that some of the error codes for PubSub are "retryable", such as this one. I took a quick look at Java and Python PubSub clients at GitHub, and apparently there is some kind of "auto-retry" for UNAVAILABLE errors.

Is there such a feature in the node client? If not, should I expect this for v1.0 ?

If it is not possible to auto reestablish the connection, how can I do this manually?

Thanks for the help.

Metadata

Metadata

Assignees

Labels

type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions