-
-
Notifications
You must be signed in to change notification settings - Fork 28
fix multiple tasks coexists at same time when rescheduled. #136
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way of writing a test to detect this? It would be good to prevent it from being reintroduced in the future.
I think there is no way to test this because it is done atomically. Maybe it one way to do it but i am not sure. It can be done a method that will request the number of tasks between the task is executing and it is scheduled. Let me try it. |
this async test wont work will be stuck to infinite if the beahviour is changed. |
i dont know how to set a timeout |
this test does not seem to be consistant, the only way is consistant is that it will be stuck if the task is scheduled before runned. |
Ignored tests seem to not be working right now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The blocking::worker::worker_tests::executes_task_only_of_specific_type
seems to be failing under specific circumstances on my machine. I'd be thankful if someone confirmed they had the same problem. The commands I run are the following:
make db
make diesel
git restore fang/src/blocking/schema.rs
make tests
make ignored
The test seems to only fail if both git restore
and make tests
are run.
I use git restore
because make diesel
adds a #[max_length = 64]
line in fang/src/blocking/schema.rs
right above uniq_hash -> Nullable<Bpchar>,
.
yeap this commit should fix your issue when running ignored tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I have been working with fang and I have noticed that it is a small period of time that two exactly equal tasks can live at the same time,
In order to fix this i have just reorder the code to
First execute task
then reschedule the task.
This way when a task is runned and the RetentionMode is set to remove it when it is finished, the task will be removed before it is reschedule the new task.