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

Job Cancellation Support #587

Open
d4rkm0nkey opened this issue Jan 29, 2024 · 7 comments
Open

Job Cancellation Support #587

d4rkm0nkey opened this issue Jan 29, 2024 · 7 comments
Labels
enhancement New feature or request non-essential this is a low priority issue which will be dealt with eventually up for grabs community contribution is needed for this issue

Comments

@d4rkm0nkey
Copy link

When I add a Job to a JobQueue, I want to be able to cancel the job afterwards.

This is how I would imagine it to be:
QueueJobAsync could return a reference to the created job, which features a Cancel method.
When this method is called, the job is removed from the JobStorageProvider and if the JobQueue is already running it cancels the CancelationToken from the Command.

@dj-nitehawk dj-nitehawk added enhancement New feature or request pending investigation this issue is queued up to be investigted labels Jan 30, 2024
@dj-nitehawk
Copy link
Member

had a brief look at implementing this but can't seem to find a way do it without introducing a major breaking change.
most likely this will be done with the next major version jump of FE (for which there's no plan atm).
until then, i'll leave this issue open for the community in case somebody can figure out a way without breaking changes.


in the meantime, i'd like to understand a bit more why exactly do you need this?
i.e what is the use case where you need to cancel the job early?
is simply setting a job expiry/execution limit not sufficient?

@dj-nitehawk dj-nitehawk added up for grabs community contribution is needed for this issue non-essential this is a low priority issue which will be dealt with eventually and removed pending investigation this issue is queued up to be investigted labels Jan 31, 2024
@d4rkm0nkey
Copy link
Author

d4rkm0nkey commented Jan 31, 2024

I would like to have Jobs that take a long time e.g. 4h. The jobs can be started manually, but sometimes it might be called with wrong parameters or during development, you might not want to wait until the job has finished. So it would be convenient to cancel a job that is already running, to then restart it with the correct parameters.

@Woodman9
Copy link

Woodman9 commented Mar 8, 2024

I'm wondering if one of you maybe know how to fix an issue with JobStorageProvider. I created a mongodb-atlas account, got the connection string and put it in the Fastendpoints solution. When I run the app I get: System.ArgumentException: ''mongodb://:@olaxxwh.mongodb.net/?authSource=admin:27017' is not a valid end point. (Parameter 'value')'. The bizarre thing is how the init function stuffed the port number in the connection string. Can someone point me to information on how to get mongodb provider to work in the Fastendpoints solution??

@dj-nitehawk
Copy link
Member

@Woodman9 the FE storage provider is db engine agnostic. so there's really no special handling you need to do for FE.

by the looks of it, something has mangled up your connection string. afaik, the mongo connection string looks something like this:

mongodb://{username}:{password}@{hostname}:{port}/?authSource=admin

can't give you exact steps for the official driver + atlas as i have not played with atlas in a long time.

you might have some luck with my mongo library. and here's a sample job storage provider written for that lib.

@Woodman9
Copy link

Woodman9 commented Mar 8, 2024

I so much appreciate your help!! The string you posted is actually exactly what I have. It would be helpful to have an example implementation of Mongo because I simply cannot understand how you guys make this work. The "InitDatabase(DbName)" in program.cs fails with the above message I posted. It's like Mongo is detecting environment and stuffing 27017 port into the connection string. I have no idea how to control that. I'm going to keep digging, but some sample code or comments would be helpful in the project template. Again, you reply is very much appreciated.

@dj-nitehawk
Copy link
Member

@Woodman9 if you join our discord server and create a post with a repro project, I can look in to it for you.

@Woodman9
Copy link

Woodman9 commented Mar 8, 2024

I will do that! I would like to become a contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request non-essential this is a low priority issue which will be dealt with eventually up for grabs community contribution is needed for this issue
Development

No branches or pull requests

3 participants