Closed hauleth closed 6 years ago
@hauleth why did you get a DoS? Because queues started to get full and never emptied?
@josevalim permanent
jobs will be restored regardless of the reason of the job exit reason, which mean that jobs that exited normally (because they finished their job, and aren't needed) are restarted by supervisor (because these are permanent
), but due to the fact that their job is one time these jobs fails now with error, and are restarted again and whole process fails again, and that is happening until supervisor stop restarting due to reaching maximum restarts count. But while so these jobs keep occupying Ecto
connections pool, which makes other processes to wait until these timeout and whole app goes down.
I think that in case of ConsumerProducer
restart
field should be required or it should defaults to transistent
instead of permanent
, as this would prevent restarting job after it exited normally.
@fishcakez do we want to raise here, if permanent was given? Or maybe always warn?
@josevalim so if the child is permanent, the supervisor can only consume the first max_demand
events from a subscription and processing each event must last "forever" or until terminate_child/2
is called. If a behavior like that is desired I think using manual
with a GenStage
process and a separate supervisor would be clearer and more explicit. Therefore I think we should raise to prevent error as there isn't a good use for permanent and permanent may trip people up.
Fixed and release v0.13.1!
This lead today to DoS in my application and I didn’t found mention about such case in docs. Official introduction into
ConsumerProducer
leave that to default value (which ispermanent
according toSupervisor
spec).