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

Pubsub: Warning during acknowledgement message on subscription with enabled Exactly once delivery flag #1266

Closed
rozhkova-syberry opened this issue Sep 9, 2022 · 6 comments
Assignees
Labels
api: pubsub Issues related to the googleapis/java-pubsub API. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@rozhkova-syberry
Copy link

rozhkova-syberry commented Sep 9, 2022

Environment details

  1. OS type and version: Windows 10
  2. java version: 11
  3. spring boot version: 2.6.7
  4. google-cloud-pubsub library version: 1.115.1

Steps to reproduce

  1. Create pubsub subscription on gcp with the following configurations:
    • Delivery type: Pull
    • Acknowledgment deadline: 600 secs
    • Exactly once delivery: True
    • Retry policy: retry immediately
  2. Create spring boot application and add
    • 'com.google.cloud:spring-cloud-gcp-starter-pubsub' as a dependency . This dependency contains google-cloud-pubsub library
      1.115.1
    • mavenBom "com.google.cloud:spring-cloud-gcp-dependencies:3.1.0"
  3. Configure PubSubConfiguration class to receive messages from specified subscription

Code

PubSubConfiguration class

    @Bean 
    public PubSubInboundChannelAdapter messageChannelAdapter(
        @Qualifier("inputChannel") MessageChannel inputChannel,
        PubSubTemplate pubSubTemplate
    ) {
        PubSubInboundChannelAdapter adapter =
            new PubSubInboundChannelAdapter(pubSubTemplate, subscriptionName);
        adapter.setOutputChannel(inputChannel);
        adapter.setAckMode(AckMode.MANUAL);
        adapter.setPayloadType(WorkflowEventMessage.class);
        adapter.setErrorChannelName(ERROR_CHANNEL_NAME);

        return adapter;
    }

    @Bean
    @Qualifier("inputChannel")
    public MessageChannel inputChannel() {
        return new DirectChannel();
    }

    @Bean
    @ServiceActivator(inputChannel = "inputChannel")
    public MessageHandler messageReceiver() {
        // do the logic
       originalMessage.ack();
    }

application.yaml

spring:
  cloud:
    gcp:
      pubsub:
        subscriber:
          max-ack-extension-period: 600

Actual behavior
Periodically I see in the logs warning

com.google.api.gax.rpc.InvalidArgumentException: io.grpc.StatusRuntimeException: INVALID_ARGUMENT: Some acknowledgement ids in the request were invalid. This could be because the acknowledgement ids have expired or the acknowledgement ids were malformed

After investigation I found that this exception appears after modifyAckDeadline call during acknowledgement pubsub message.

Expected behavior
No warnings in the logs.

Additional information
Pubsub messages are processed successfully without redeliveries but with this warning in the logs.
I updated google-cloud-pubsub library to 1.120.12 and tested it, but I still saw this warning in the logs.
If Exactly once delivery is disabled on subscription than there are no warnings in the logs.
Why this warning is displayed and and what issues it can potentially cause?

@product-auto-label product-auto-label bot added the api: pubsub Issues related to the googleapis/java-pubsub API. label Sep 9, 2022
@rozhkova-syberry rozhkova-syberry changed the title Pubsub: Warning on subscription with enabled Exactly once delivery Pubsub: Warning during acknowledgement message on subscription with enabled Exactly once delivery flag Sep 9, 2022
hannahrogers-google pushed a commit to hannahrogers-google/java-pubsub that referenced this issue May 12, 2023
hannahrogers-google pushed a commit to hannahrogers-google/java-pubsub that referenced this issue May 12, 2023
🤖 I have created a release \*beep\* \*boop\*
---
## [1.115.0](https://www.github.com/googleapis/java-pubsub/compare/v1.114.7...v1.115.0) (2021-12-05)


### Features

* creating java backport ([googleapis#895](https://www.github.com/googleapis/java-pubsub/issues/895)) ([51b01e2](https://www.github.com/googleapis/java-pubsub/commit/51b01e254a4be87a8a779fbc5da697c70920d82f))


### Bug Fixes

* **java:** java 17 dependency arguments ([googleapis#1266](https://www.github.com/googleapis/java-pubsub/issues/1266)) ([googleapis#888](https://www.github.com/googleapis/java-pubsub/issues/888)) ([ed3ae2f](https://www.github.com/googleapis/java-pubsub/commit/ed3ae2fb0a0c72073f6bae5dc4111424740fd883))


### Dependencies

* update dependency com.google.cloud:google-cloud-core to v2.3.0 ([googleapis#913](https://www.github.com/googleapis/java-pubsub/issues/913)) ([adfd456](https://www.github.com/googleapis/java-pubsub/commit/adfd4562a8041d71af65cd98cf1d17b881e35dd3))
* update dependency com.google.cloud:google-cloud-core to v2.3.1 ([googleapis#927](https://www.github.com/googleapis/java-pubsub/issues/927)) ([9fcc996](https://www.github.com/googleapis/java-pubsub/commit/9fcc9965284f6a57dc79f31eb96a2e430cef72e4))
* update dependency com.google.cloud:google-cloud-core to v2.3.2 ([googleapis#941](https://www.github.com/googleapis/java-pubsub/issues/941)) ([41f881b](https://www.github.com/googleapis/java-pubsub/commit/41f881b2d075f9ee730f5eaf24885146d9fadccf))
* update dependency com.google.cloud:google-cloud-core to v2.3.3 ([googleapis#943](https://www.github.com/googleapis/java-pubsub/issues/943)) ([df3a5fe](https://www.github.com/googleapis/java-pubsub/commit/df3a5fecd4d87ae79cba312109242146b84f9e55))
* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.5.0 ([googleapis#919](https://www.github.com/googleapis/java-pubsub/issues/919)) ([4adf335](https://www.github.com/googleapis/java-pubsub/commit/4adf335b78ce6b13af22c3c3a64c4ea1a24f05cd))
* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.5.1 ([googleapis#942](https://www.github.com/googleapis/java-pubsub/issues/942)) ([44cdcf5](https://www.github.com/googleapis/java-pubsub/commit/44cdcf5d3f1815654b9b255c1096e290a7db9030))
* update dependency com.google.errorprone:error_prone_annotations to v2.10.0 ([googleapis#901](https://www.github.com/googleapis/java-pubsub/issues/901)) ([8733144](https://www.github.com/googleapis/java-pubsub/commit/8733144854aaebfec0cd5f03ab14d820c6d22c0e))
* update dependency com.google.protobuf:protobuf-java-util to v3.19.1 ([googleapis#885](https://www.github.com/googleapis/java-pubsub/issues/885)) ([d0a02a9](https://www.github.com/googleapis/java-pubsub/commit/d0a02a9f320b254a3e4ef60bfff47a6bb3a2427f))
* update dependency org.apache.avro:avro to v1.11.0 ([googleapis#894](https://www.github.com/googleapis/java-pubsub/issues/894)) ([b7ba1a8](https://www.github.com/googleapis/java-pubsub/commit/b7ba1a871c4c26f50d87b41c2627b6e6aef63b3c))
* update gson to 2.8.9 ([ec97e93](https://www.github.com/googleapis/java-pubsub/commit/ec97e93ae53666d5c5cad71821f12cefa4fbaf2e))
---


This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
@samcrutt9900
Copy link

I'm experiencing exactly the same issue as this using 1.123.12 of the client lib and subscribing to an exactly once delivery subscription.

@maitrimangal maitrimangal added the type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. label Aug 16, 2023
@maitrimangal maitrimangal self-assigned this Aug 16, 2023
@maitrimangal
Copy link
Member

Might be fixed with #1540

@maitrimangal
Copy link
Member

Just merged this PR #1540 , please reopen this issue if the problem you are having still reoccurs.

@Sourc
Copy link

Sourc commented Oct 20, 2023

I've seen this issue as well when looking into another issue #1778, so it still seems to be there. It happens separately from the concurrent modification issues.

@kamalaboulhosn
Copy link
Contributor

@Sourc What is the version of Spring and the client library you are using?

@Sourc
Copy link

Sourc commented Oct 25, 2023

@kamalaboulhosn No Spring, same setup as described in #1778. But I actually believe my warnings are caused by the soft-crashing of the subscribers, so it's most likely different from what's been the cause here. No need to re-open this issue just yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: pubsub Issues related to the googleapis/java-pubsub API. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants