Incompatibility with Grpc.Core.Api v2.25.0 and Grpc.Core 1.22.1
See original GitHub issueIt 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
- 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)
- Using Nuget package manager, add reference to Google.Cloud.PubSub.V1 (v1.0.0 or v1.1.0)
- 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 asawait subscriber.StopAsync(TimeSpan.FromSeconds(1))
after a 10 secondTask.Delay
. 3b. Log the message body to console or debug window for visual verification (exactly as in documentation - but alwaysreturn SubscriberClient.Reply.Ack
3c. Add a debug/console output immediately after theawait subscriber.StopAsync
line. - 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.
- 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)
- 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 thestopAsync
should have aborted any connections, yet the application still has not closed nor reached the output aftersubscriber.StopAsync
(bug number 1) - Stop/Cancel Debugging in VS.
- 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).
- 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:
- Created 4 years ago
- Reactions:1
- Comments:9
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Closing this issue now as there’s no change required in this repo. Hopefully only a week until it becomes naturally obsolete…
It is clear that
PubSub
is not the only library affected, my idea was to increase discoverability as I experienced it trying to integratePubSub
in my project.I would say that this thread is already useful in that direction.