question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incompatibility with Grpc.Core.Api v2.25.0 and Grpc.Core 1.22.1

See original GitHub issue

It appears that Grpc.Core.Api v2.x is incompatible with Grpc.Core v1.x, however the dependencies listed on each library does not restrict users from installing the two incompatible versions.

This can possibly be triggered in normal situations by doing a “global” update for all Nuget packages in your solution - if you happen to have Grpc.Core v1.x and Google.Api.Gax.Grpc v2.10.0 installed as I did, attempting to perform “all available” updates in VS2019 will result in a scenario where Grpc.Core remains on v1.x but Grpc.Core.Api gets updated to the incompatible v2.x library.

Environment details

  • OS: Windows (Server 2016, Windows 10)
  • .NET version: Framework 4.6.1, 4.7.2
  • Package name and version: Grpc.Core.Api v2.25.0, Grpc.Core 1.22.1, Google.Api.Gax.Grpc v2.10.0, Google.Cloud.Pubsub.V1 v1.1.0

Steps to reproduce

  1. Create new .net Framework console application (4.6.1 and 4.7.2 confirmed, likely impacts additional versions), in Visual Studio 2019 (VSCode may work as well)
  2. Using Nuget package manager, add reference to Google.Cloud.PubSub.V1 (v1.0.0 or v1.1.0)
  3. Follow steps at https://cloud.google.com/pubsub/docs/pull to create a topic/subscription, and configure your console application to create subscriber for newly created topic. 3a. Ensure you are using the async/await modifiers. Do not await subscriber.StartAsync, but ensure the stop is called as await subscriber.StopAsync(TimeSpan.FromSeconds(1)) after a 10 second Task.Delay. 3b. Log the message body to console or debug window for visual verification (exactly as in documentation - but always return SubscriberClient.Reply.Ack 3c. Add a debug/console output immediately after the await subscriber.StopAsync line.
  4. Seed topic with messages (any size or content - this step is optional as one part of the bug does not require any messages). Around 20 small (<10kb) messages usually proves sufficient.
  5. Using Nuget package manager, Update Grpc.Core.Api version from 1.x to 2.x (note that Grpc.Core and Grpc.Auth 1.x does not have any dependency on Grpc.Core.Api version, nor is the inverse true)
  6. Debug the application. Note that messages are being consumed from the stack. With 10-20 messages, you should see all messages that were previously in the queue within a few seconds. After 15 seconds, note that the 10 second Task.Delay has passed, and the stopAsync should have aborted any connections, yet the application still has not closed nor reached the output after subscriber.StopAsync (bug number 1)
  7. Stop/Cancel Debugging in VS.
  8. Inspect the subscription’s unacked message count on console.cloud.google.com. Note that while it may have gone down by a few messages, all (10-20) messages should be gone, but some still remain. (bug number 2).
  9. Update Grpc.Core.Api to v1.x (matching Grpc.Core version) and re-run applications. Note that after approximately 10 seconds, the application gracefully exits, and the unacked message count is now at zero.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:9

github_iconTop GitHub Comments

1reaction
jskeetcommented, Mar 9, 2020

Closing this issue now as there’s no change required in this repo. Hopefully only a week until it becomes naturally obsolete…

0reactions
draganjovanovic1commented, Mar 5, 2020

It is clear that PubSub is not the only library affected, my idea was to increase discoverability as I experienced it trying to integrate PubSub in my project.

I would say that this thread is already useful in that direction.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Grpc.Core.Api 2.55.0
Version Downloads Last updated 2.56.0‑pre2 1,297 5 days ago 2.56.0‑pre1 3,753 19 days ago 2.55.0 1,110,162 2 months ago
Read more >
Troubleshoot gRPC on .NET
Unable to start ASP.NET Core gRPC app on macOS. Kestrel doesn't support HTTP/2 with TLS on macOS before .NET 8. The ASP.NET Core...
Read more >
API/ABI changes review for gRPC Core
Version Date BC SC Added Methods Removed Methods 1.32.1 2020‑09‑10 100% 100% 0 0 1.31.1 2020‑08‑12 100% 100% 0 0 1.31.0 2020‑07‑29 100% 100% 1 new...
Read more >
Grpc.Auth: Could not load type 'Grpc.Core.CallCredentials ...
Core.Api, with type forwarding handling the compatibility issue. That's fine until you use code that expects the split to be present, but finds ......
Read more >
Changelog — google-api-core documentation
As of January 1, 2020 this library no longer supports Python 2 on the latest released ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found