Haidra-Org/AI-Horde

Return `job_ttl` with jobpop

Closed this issue · 2 comments

Returning this field can help worker client software make better decisions in certain situations. In the event of an unhandled worker fault and the worker is trying to recover, knowing if there is enough time to submit by the timeout will allow the worker to give up sooner (submitting the job as faulted) instead of attempting to regenerate the image where there is not enough time.

It is worth noting that this field has never been a secret. However, by explicitly returning it and highlighting its existence, there is a possibility that certain types of bad actors could exploit this information to deliberately deteriorate the service.

db0 commented

@tazlin commit ea2d840 will add the ttl field on pop. Is this OK to push live, or will it cause SDK problems?

@tazlin commit ea2d840 will add the ttl field on pop. Is this OK to push live, or will it cause SDK problems?

This should be OK to push live. I tested locally and it doesn't cause any crashes/issues from the perspective of the extra field alone. I haven't exhaustively tested the rest of your changes.