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

[Bug Report]: FileLoadException on ConsumerWorker execution is silently ignored #590

Open
1 task done
luispfgarces opened this issue Aug 21, 2024 · 1 comment
Open
1 task done
Labels
bug Something isn't working

Comments

@luispfgarces
Copy link

Prerequisites

  • I have searched issues to ensure it has not already been reported

Description

If the ConsumerWorker background task fails to start, it is silently ignored without any exception or logs to the KafkaFlow users.

In my particular case, the background task fails with TypeLoadException due to a missing binding redirect, leaving the background task in a faulted state - it will appear to the users as if the application is not consuming, and no middlewares will be executed.

I ended up resolving the root cause by adding a binding redirect, but I think that KafkaFlow should let the user know something has failed in order to assist troubleshooting.

Steps to reproduce

  1. Create a ASP.NET Framework web application (in my case, using .NET Framework 4.6.2)
  2. Add and configure KafkaFlow packages (I'm using version 3.0.10). Add any middlewares you want.
  3. Add Microsoft.Bcl.AsyncInterfaces version 8.0.0 to your web application.
  4. Ensure no binding redirect is added to app.config/web.config.
  5. Debug the application until reaching the ConsumerWorker.StartAsync(...).

KafkaFlow is expecting Microsoft.Bcl.AsyncInterfaces version 6.0.0, and as such will throw a TypeLoadException due to failed assembly binding.

Expected behavior

I expected that KafkaFlow would report an error through an exception or through an error log.

Actual behavior

Silently fails the background task on ConsumerWorker. After inspection on debug, the following exception is observed:

Could not load file or assembly 'Microsoft.Bcl.AsyncInterfaces, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

KafkaFlow version

3.0.10

@luispfgarces luispfgarces added the bug Something isn't working label Aug 21, 2024
@luispfgarces
Copy link
Author

Adding screenshot.

image

Let me also suggest resolving this with a task continuation that verifies if this task has failed, and takes proper action after (e.g. emit an error log and setting the consumer state appropriately).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

1 participant