Skip to content

Users can raise RescheduleTask but TaskSets cannot? #2652

Closed
@bakhtos

Description

@bakhtos

Prerequisites

Description

So as far as I understand, Users can raise RescheduleTask error directly in the code, but TaskSets use this error internally so inside a TaskSet task one needs to use self.interrupt(), otherwise raising RescheduleTask causes unexpected behaviour?

I had an issue with my code where I first implemented some tasks directly inside a User instance and they raised RescheduleTask error, but then I refactored the code so that the tasks are inside a TaskSet, and there was unexpected behaviour with these tasks (locust seemed to be stuck inside one as soon as it was executed) until I replaced all instances of raise RescheduleTask() with self.interrupt().

Should the interface be somehow unified so that both Users and TaskSets have methods e.g. self.reschedule() and self.interrupt()and RescheduleTask error is only used internally and never raised in user-written code?

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requeststaleIssue had no activity. Might still be worth fixing, but dont expect someone else to fix it

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions