Closed matti closed 6 years ago
Same with:
class SimpleWorkflow < Gush::Workflow
def configure
run FirstDownloadJob, before: SaveJob
run SecondDownloadJob, before: SaveJob
run SaveJob
end
end
actually... ...this is intended behaviour? Is there a way to call SaveJob just once?
so that both DownloadJobs would be completed before
It definitely should only trigger the SaveJob only once. Will reproduce and fix, because this is a regression :(
On Nov 4, 2017 16:58, "Matti Paksula" notifications@github.com wrote:
so that both DownloadJobs would be completed before
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/chaps-io/gush/issues/46#issuecomment-341907968, or mute the thread https://github.com/notifications/unsubscribe-auth/AAIQ6k4MRk4vNI5cp5qJKIjFXa6IRCNaks5szImMgaJpZM4QSDbU .
Actually, I'm not sure if this behaviour is a bug - it follows the diagram nicely - each notification job triggers another job... But yes, this was the main use case for using gush for me.
Yeah this is unintended, it should only trigger the job if all of its dependencies have finished successfully. So only the second check should see that the other job finished and only then should enqueue the SaveJob. I suspect the state is incorrectly persisted along the way.
On Nov 4, 2017 17:01, "Matti Paksula" notifications@github.com wrote:
Actually, I'm not sure if this behaviour is a bug - it follows the diagram nicely - each notification job triggers another job... But yes, this was the main use case for using gush for me.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/chaps-io/gush/issues/46#issuecomment-341908217, or mute the thread https://github.com/notifications/unsubscribe-auth/AAIQ6ng67hnNXXlSNaB-U_KbhCf4n5H7ks5szIpjgaJpZM4QSDbU .
clarification: yes, it's a bug - but also an interesting feature that kinda follows the diagram.
Ha, maybe that also needs a configuration option :D
On Nov 4, 2017 17:13, "Matti Paksula" notifications@github.com wrote:
clarification: yes, it's a bug - but also an interesting feature that kinda follows the diagram.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/chaps-io/gush/issues/46#issuecomment-341909094, or mute the thread https://github.com/notifications/unsubscribe-auth/AAIQ6vHTceEHCKBQGR9m5PItMZqCKee6ks5szI0ygaJpZM4QSDbU .
I also experienced this behavior in my tests
Any updates about this? We have encountered this as well.
Hi, is there any news about this bug?
@erated @tanin haven't had a chance to investigate, but can you share your minimal case to reproduce, too? Will help tracking it down.
@pokonski isnt my original example in the beginning of thia thread enough?
@matti it's enough, I reproduced it in specs but seems to be caused by a race condition when using an async adapter for ActiveJob.
Alright, master now contains a fix for this issue @dmitrypol @matti @tanin. Please let me know if it helps!
This should only be an issue for jobs finishing almost at the same time, most apparent in tests because usually the jobs are empty and execute close to each other. I added a mutex so only one of the ancestors can en-queue his descendant at any given time while others have to wait.
But atleast I didn't use ActiveJob. let's test this..
@matti it's not actually related to ActiveJob, it's simply caused when jobs are running in parallel and both trigger their descendant veeery close to each other. Now I put a lock so triggering new jobs is run one at a time, solving the race condition.
@matti it's not actually related to ActiveJob, it's simply caused when jobs are running in parallel and both trigger their descendant veeery close to each other. Now I put a lock so triggering new jobs is run one at a time, solving the race condition.
is this bug fixed then?
@pokonski ?
@lastobelus Yes, fixed in https://github.com/chaps-io/gush/commit/49000a30fd34ac21cabdc7d2c24ffbfa3b113bb9
Tried the README's example:
SaveJob
will be invoked twice: