• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

GoogleCloudPlatform / google-cloud-java / 3078
72%

Build:
DEFAULT BRANCH: master
Ran 15 Feb 2017 03:14AM UTC
Jobs 1
Files 458
Run time 20s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
3078

Pull #1625

travis-ci

web-flow
pubsub: start with polling by default

Previously, Subscribers start with streaming pull and fall back
to polling pull if streaming is unavailable.
To prevent fallback or streaming from causing any problem in production,
this commit starts Subscribers with polling pull directly.
Streaming pull will be re-enabled once the endpoint is working.

Since the ultimate fate of fallback is up in the air,
I chose to comment out the start-with-streaming code instead of
deleting.

This change also smoked out a logic bug that causes a race condition.
A message can be "nacked" either by calling AckReplyConsumer::accept
with an explicit NACK or a throwable signally an error.
The explicit NACK case works properly.

In case of a throwable, MessageDispatcher did not set the "acked" flag.
(Acks and nacks share most of the same code path;
they might as well use the same flag.)
This causes two things to happen concurrently.

1. Since the message is being nacked, it is added to the nack list
to be reported to the pubsub service.

2. Pubsub client automatically extends deadlines of the messages
the client's user is processing. Since acked flag is not set,
the client also tries to extend the message's deadline.

If (1) happens first, the test code sees that the message is being
nacked and the test passes even though the client will later
incorrectly extend the message's deadline.

If (2) happens first, the test code sees the incorrect deadline
extension and fails.

The fix is simple: set the acked flag.
Pull Request #1625: pubsub: start with polling by default

5 of 5 new or added lines in 3 files covered. (100.0%)

20038 of 24697 relevant lines covered (81.14%)

119.08 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
100.0
google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/Subscriber.java

Uncovered Existing Lines

Lines Coverage ∆ File
1
100.0
google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/StatusUtil.java
4
100.0
google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/MessageDispatcher.java
8
100.0
google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/PollingSubscriberConnection.java
41
100.0
google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/Subscriber.java
73
100.0
google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/StreamingSubscriberConnection.java
Jobs
ID Job ID Ran Files Coverage
2 3078.2 15 Feb 2017 03:14AM UTC 0
81.14
Travis Job 3078.2
Source Files on build 3078
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #3078
  • Pull Request #1625
  • PR Base - master (#3077)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc