pardahlman / RawRabbit

A modern .NET framework for communication over RabbitMq
MIT License
746 stars 144 forks source link

Every publish fails with PublishConfirmExceptions when ExclusiveLock fails #373

Open frbatist opened 6 years ago

frbatist commented 6 years ago

Hello!

I've got an strange behavior on a production enviroment with 2.0 rc5.

The service was stopped for deploy, and when restarted, not a single message was published, until restarted again. The service basically consumes some queues and send messages to another queue with details of the work done.

Looking at the logs, I managed to identify that the problem ocurred after the folowing exception: 2018-09-27 16:18:41.4757||ERROR|RawRabbit.Common.ExclusiveLock|Exception when performing exclusive execute

After that, all of the publishes results in the folowing error:

2018-09-27 16:18:51.6381||ERROR|Wms.TaskManagement.Services.Api.Standard.Consumers.LoadConsumer|System.AggregateException: One or more errors occurred. ---> RawRabbit.Exceptions.PublishConfirmException: The broker did not send a publish acknowledgement for message 1 within 0:00:10. at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at RawRabbit.Operations.Publish.Middleware.PublishAcknowledgeMiddleware.d__9.MoveNext()

Unfortunately, I can't reproduce the error, so I'm here in the hopes of some light.

I saw in the RawRabbit source code that this log (Exception when performing exclusive execute) also logs the exception, but, can't find it on the log file.

Thanks for the help.

frbatist commented 5 years ago

I've searched further in the source code, and I managed to find that the exception sent to the log along with the message: "Exception when performing exclusive execute" at "RawRabbit.Common.ExclusiveLock", is not beeng logged. It would have been easier to trobleshoot the problem with the exception on the log (or not haha)

I'm gonna forkit see if I manage to fix it and submit PR.

MikeAndrews90 commented 4 years ago

@frbatist I know this was a long time ago now but did you ever resolve this?