hyperf / hyperf/task

在多进程的task任务中,存在获取数据异常问题

Open
#1 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
9
Forks
2
PR merge metrics
No merged PRs in 30d

Description

![image](https://user-images.githubusercontent.com/7343318/175453541-e77c600f-359b-410e-ac1c-11f29e2f23bd.png)

遇到一个比较极限的问题,在多进程的task任务中,存在获取数据异常问题。

swoole官方文档上对task_id的产生描述是这样的:
![image](https://user-images.githubusercontent.com/7343318/175453766-14b8ce09-772f-4909-a614-f059fa54d709.png)

根据以上描述可以理解为:在多进程的task任务中,每个task_id在其task进程内是唯一的,其它进程可能是不唯一的,则可以判断此处逻辑存在问题`$result = $this->factory->pop($taskId, $timeout);`

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing the `$this->factory->pop($taskId, $timeout)` call and the task_id behavior described in the issue. Reproduce the abnormal data retrieval in a multi-process task, then verify that results are matched to the correct task rather than relying on an identifier that may repeat across task processes.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.