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.

Persistent Channel error (potential timeout issue) while performing a "PublishAsync" or "RespondAsync" but not limited to these

See original GitHub issue

So i have created a simple worker service (.Net 7), which has the following code snippet.

rabbitMqBus = RabbitHutch.CreateBus("host=localhost");

await rabbitMqBus.Rpc.RespondAsync<ConnectToServerRequest, ConnectToServerResponse>(async request => { return new ConnectToServerResponse() { IsSeverConnected = true }; });

This code works absolutely fine on my laptop (dev machine), however, whenever i run it as a service or using a cmd on a deployment machine, i get the following error. Im not sure if im supposed to configure something before installing as a service (both RabbitMQ and the service is on the same machine, RabbitMQ Service is running. Also “RabbitMQ Webinterface “localhost:15672” does work properly on the deployment machine”)

I get the same error when i manually stop the RabbitMQ Service on my dev machine. (while trying to reproduce)

Following in the error, there is no cancellation token passed, i think it is a TimeOut error.

2023-05-22 17:23:49.750 +02:00 [ERR] BackgroundService failed System.Threading.Tasks.TaskCanceledException: A task was canceled. at EasyNetQ.Persistent.PersistentChannel.InvokeChannelActionAsync[TResult,TChannelAction](TChannelAction channelAction, CancellationToken cancellationToken) at EasyNetQ.RabbitAdvancedBus.ExchangeDeclareAsync(String name, Action1 configure, CancellationToken cancellationToken) at EasyNetQ.DefaultRpc.RespondAsyncInternal[TRequest,TResponse](Func3 responder, Action1 configure, CancellationToken cancellationToken) at Worker.ExecuteAsync(CancellationToken cancellationToken) in C:\Users\Server\Worker.cs:line 50 at Microsoft.Extensions.Hosting.Internal.Host.TryExecuteBackgroundServiceAsync(BackgroundService backgroundService) 2023-05-22 17:23:49.770 +02:00 [FTL] The HostOptions.BackgroundServiceExceptionBehavior is configured to StopHost. A BackgroundService has thrown an unhandled exception, and the IHost instance is stopping. To avoid this behavior, configure this to Ignore; however the BackgroundService will not be restarted. System.Threading.Tasks.TaskCanceledException: A task was canceled. at EasyNetQ.Persistent.PersistentChannel.InvokeChannelActionAsync[TResult,TChannelAction](TChannelAction channelAction, CancellationToken cancellationToken) at EasyNetQ.RabbitAdvancedBus.ExchangeDeclareAsync(String name, Action1 configure, CancellationToken cancellationToken) at EasyNetQ.DefaultRpc.RespondAsyncInternal[TRequest,TResponse](Func3 responder, Action1 configure, CancellationToken cancellationToken) at Worker.ExecuteAsync(CancellationToken cancellationToken) in C:\Users\Server\Worker.cs:line 50 at Microsoft.Extensions.Hosting.Internal.Host.TryExecuteBackgroundServiceAsync(BackgroundService backgroundService)

Please complete the following information):

  • EasyNetQ version: 7.5.2
  • RabbitMQ version 3.11.16

Issue Analytics

  • State:closed
  • Created 4 months ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Plinercommented, May 24, 2023

@OmkarDaundVario @richard-green

Sorry, I forgot to reply yesterday. Current approach (with throwing OCE in the case unavailability to execute a command in a configured timeout) causes a lot of complaints and lack of visibility of errors under the hood.

I am trying to rework it in v7, hopefully will be able to do it. Otherwise, a fix will be available only for v8.

0reactions
OmkarDaundVariocommented, May 24, 2023

@Pliner i appreciate the additional info.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The operation requested on PersistentChannel timed out
Has anyone seem this issue occur intermittently when the RabbitMQ cluster itself is fully available and has no capacity issues?
Read more >
EasyNetQ fails to publish to RabbitMQ - PersistentChannel ...
I get a TimeoutException The operation requested on PersistentChannel timed out. . Remote VM is replying to pings, ports 5672 and 15672 are...
Read more >
SubscribeAsync() limits when player count updates - ...
The wiki states that the max subscription limit is 5 + 2*numPlayers. We have two subscriptions per player, each of which is being...
Read more >
ReadMyDocs Documentation
Implementing the publish/subscribe pattern can be done with just a few lines of code. The. SubscribeAsyn<TMessage> method takes one argument ...
Read more >
Move Mailbox fail in some of many child domains
Hi all I'm trying to migrate mailboxes in a multi domain forest. There's only one Exchange Organization with all the users on it....
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