[BUG]: supertask not respecting max agents

Aperta
#2,497 1 commento 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@jessevz ci sta già lavorando.

Dal 16/9/2026.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

bug server
Version Information

1.0.1

Hashcat

7

Description

Sometimes it happens that a supertask with a max agents for example 10, more agents will jump on it. I suspect that the reason is, is that the function: isSaturatedByOtherAgents() will check how many agents are assigned to a task and compare that to the max agents of that single task. but it does not check if there are already too much agents working on the supertask. this only happens in the getChunk endpoint (when an agent is already assigned to a task), because here it is run like this:

        if (TaskUtils::isSaturatedByOtherAgents($task, $agent)) {

Only on the current assigned task, without checking the taskwrapper.

In the gettaskAction there is a wrapper in the form of getcanidatetasks, which will run this function for every task of a taskwrapper:

  private static function getCandidateTasks(Agent $agent, array $accessGroups, TaskWrapper $taskWrapper): array {
    $totalAssignments = 0;
    $candidateTasks = [];
    
    // load assigned tasks for this TaskWrapper
    $qF = new QueryFilter(Task::TASK_WRAPPER_ID, $taskWrapper->getId(), "=");
    $oF = new OrderFilter(Task::PRIORITY, "DESC");
    $tasks = Factory::getTaskFactory()->filter([Factory::FILTER => $qF, Factory::ORDER => $oF]);
    foreach ($tasks as $task) {
      // count number of other agents already working on the task,
      // no tasks can be candidates if limit is already reached
      $totalAssignments += self::numberOfOtherAssignedAgents($task, $agent);
      if ($taskWrapper->getMaxAgents() > 0 && $totalAssignments >= $taskWrapper->getMaxAgents()) {
        return [];
      }

where is called on every task numberOfOtherAssignedAgents

This is especially a problem since most of the times in a supertask, the max agents of a single sub task are set to zero, which makes the task claim every available agent on that priority

Lingua principale
PHP
Stelle
1.8k
Fork
257
Merge medio
1g 11h
PR unite (30g)
15

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di hashtopolis/server

Tutte le issue di hashtopolis/server

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.