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

Jobs never being executed #50

Open
RomanKreisel opened this issue Jul 29, 2022 · 7 comments
Open

Jobs never being executed #50

RomanKreisel opened this issue Jul 29, 2022 · 7 comments

Comments

@RomanKreisel
Copy link

I have a pretty standard setup (using ASP.NET Core 6, following examples from hangfire.io and this github page), but the jobs are never being executed.

  • plenty of documents are written to the cosmos db
  • one of them seems to contain my current machine with 20 workers
  • other ones seem to be related to the jobs (e.g. names, methods called, etc.)
  • for testing I only called static methods such as Console.WriteLine()
  • Unfortunately the jobs never get called
  • When i switched to "UseMemoryStorage()", it immediately worked as intended
  • I started with Cosmos SDK 3.27.2 - but also the upgrade to the latest 3.29.0 didn't help
@imranmomin
Copy link
Owner

@RomanKreisel - do you have a repo where I can reproduce at my end

@f1nzer
Copy link

f1nzer commented Aug 11, 2022

@imranmomin on my local machine this situation can be reproduced by replacing

o.UseAzureCosmosDbStorage(url, secretKey, database, collection, cosmoClientOptions);

with another overload (using CosmosClient instance in parameters):

o.UseAzureCosmosDbStorage(new CosmosClient(url, secretKey, cosmoClientOptions), database, collection);

Also, this line should be removed because it is redundant.

JobStorage.Current = CosmosDbStorage.Create(url, secretKey, database, collection, cosmoClientOptions);

Jobs are enqueued but not executed. There are nothing extraordinary in logs.
image
image
image

UPD:
The reason is that updating options on the Client instance has no effect, while it is actively used.

As a possible workaround Init API can be changed to use CosmosClientBuilder instead of CosmosClient, as in this simple implementation

@BeardVis
Copy link

This problem is also relevant to me.
Also, I hope for the possibility of adding CosmosDb using ConnectionString

@lzhgus
Copy link

lzhgus commented Oct 12, 2022

For me, data got saved in Cosmos Db, but Jobs never being executed. I am using MassTransit with ServiceBus. Did anyone encounter the same issue?

@maximilianbrandl
Copy link

Has this issue already been solved? I've got the same problem and this makes the extension unusable for me..

@klemmchr
Copy link

Having the same issue. This library is not usable until this is fixed.

@aligunel
Copy link

Use this overload to run the jobs.
UseAzureCosmosDbStorage(url, secretKey, database, collection, cosmoClientOptions);
With CosmosClient , it will enqueue the job but will not run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants