Skip to content

[Bug]: TestCancelRunningTask reports panic: close of closed channel #11250

Closed

Description

@LeftHandCold

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Environment

- Version or commit-id (e.g. v0.1.0 or 8b23a93):b0002bfac60998670ed15b164f51e44ada872697
- Hardware parameters:
- OS type:
- Others:

Actual Behavior

2023-08-16T06:52:35.3914480Z === RUN TestCancelRunningTask
2023-08-16T06:52:35.3914808Z 2023/08/16 06:43:28.099273 +0000 DEBUG task-runner executor registered {"runner-id": "r1", "code": "TestOnly"}
2023-08-16T06:52:35.3915103Z 2023/08/16 06:43:28.099382 +0000 DEBUG task-runner heartbeat task started {"runner-id": "r1"}
2023-08-16T06:52:35.3915378Z 2023/08/16 06:43:28.099429 +0000 DEBUG task-runner fetch task started {"runner-id": "r1"}
2023-08-16T06:52:35.3915675Z 2023/08/16 06:43:28.099465 +0000 DEBUG task-runner dispatch task started {"runner-id": "r1"}
2023-08-16T06:52:35.3915959Z 2023/08/16 06:43:28.099503 +0000 DEBUG task-runner done task started {"runner-id": "r1"}
2023-08-16T06:52:35.3916237Z 2023/08/16 06:43:28.099544 +0000 DEBUG task-runner retry task started {"runner-id": "r1"}
2023-08-16T06:52:35.3916544Z 2023/08/16 06:43:28.100685 +0000 DEBUG task-runner new task fetched {"runner-id": "r1", "count": 1}
2023-08-16T06:52:35.3916845Z 2023/08/16 06:43:28.100741 +0000 DEBUG task-runner task added {"runner-id": "r1", "task": "t1/0"}
2023-08-16T06:52:35.3917165Z 2023/08/16 06:43:28.100823 +0000 DEBUG task-runner task start execute {"runner-id": "r1", "task": "t1/0"}
2023-08-16T06:52:35.3917566Z 2023/08/16 06:43:28.102024 +0000 ERROR task-runner task heartbeat failed {"runner-id": "r1", "error": "invalid task, task runner r1, id 1"}
2023-08-16T06:52:35.3917871Z 2023/08/16 06:43:28.102096 +0000 DEBUG task-runner new task fetched {"runner-id": "r1", "count": 1}
2023-08-16T06:52:35.3918166Z 2023/08/16 06:43:28.102143 +0000 DEBUG task-runner task added {"runner-id": "r1", "task": "t1/0"}
2023-08-16T06:52:35.3918540Z 2023/08/16 06:43:28.102183 +0000 DEBUG task-runner task execute completed {"runner-id": "r1", "task": "t1/0", "cost": "54.201µs"}
2023-08-16T06:52:35.3918730Z task_runner_test.go:188:
2023-08-16T06:52:35.3919217Z Error Trace: /home/runner/work/matrixone/matrixone/pkg/taskservice/task_runner_test.go:188
2023-08-16T06:52:35.3920050Z /home/runner/work/matrixone/matrixone/pkg/taskservice/task_runner_test.go:210
2023-08-16T06:52:35.3920888Z /home/runner/work/matrixone/matrixone/pkg/taskservice/task_runner_test.go:168
2023-08-16T06:52:35.3921139Z Error: Not equal:
2023-08-16T06:52:35.3921376Z expected: 0
2023-08-16T06:52:35.3921601Z actual : 1
2023-08-16T06:52:35.3921832Z Test: TestCancelRunningTask
2023-08-16T06:52:35.3922126Z 2023/08/16 06:43:28.102444 +0000 DEBUG task-runner retry task stopped {"runner-id": "r1"}
2023-08-16T06:52:35.3922418Z 2023/08/16 06:43:28.102483 +0000 DEBUG task-runner done task stopped {"runner-id": "r1"}
2023-08-16T06:52:35.3922728Z 2023/08/16 06:43:28.102523 +0000 DEBUG task-runner task start execute {"runner-id": "r1", "task": "t1/0"}
2023-08-16T06:52:35.3923149Z 2023/08/16 06:43:28.102568 +0000 DEBUG task-runner task execute completed {"runner-id": "r1", "task": "t1/0", "cost": "46.9µs"}
2023-08-16T06:52:35.3923294Z panic: close of closed channel
2023-08-16T06:52:35.3923308Z
2023-08-16T06:52:35.3923426Z goroutine 64 [running]:
2023-08-16T06:52:35.3923792Z github.com/matrixorigin/matrixone/pkg/taskservice.TestCancelRunningTask.func1.1({_, _}, {0x1, {{0xed4bce, 0x2}, 0x0, {0x0, 0x0, 0x0}, {0x0, ...}, ...}, ...})
2023-08-16T06:52:35.3924060Z /home/runner/work/matrixone/matrixone/pkg/taskservice/task_runner_test.go:172 +0x4f
2023-08-16T06:52:35.3924327Z github.com/matrixorigin/matrixone/pkg/taskservice.(*taskRunner).run.func1({0x1c22bb8?, 0xc00030f5f0?})
2023-08-16T06:52:35.3924579Z /home/runner/work/matrixone/matrixone/pkg/taskservice/task_runner.go:402 +0x6eb
2023-08-16T06:52:35.3924936Z github.com/matrixorigin/matrixone/pkg/common/stopper.(*Stopper).doRunCancelableTask.func1()
2023-08-16T06:52:35.3925190Z /home/runner/work/matrixone/matrixone/pkg/common/stopper/stopper.go:259 +0xd2
2023-08-16T06:52:35.3925470Z created by github.com/matrixorigin/matrixone/pkg/common/stopper.(*Stopper).doRunCancelableTask
2023-08-16T06:52:35.3925727Z /home/runner/work/matrixone/matrixone/pkg/common/stopper/stopper.go:254 +0x16b
2023-08-16T06:52:35.3925931Z FAIL github.com/matrixorigin/matrixone/pkg/taskservice 1.512s

Expected Behavior

https://github.com/matrixorigin/matrixone/actions/runs/5875485736/job/15931839782

Steps to Reproduce

No response

Additional information

No response

Activity

  1. added this to the 1.0.0 milestone on Aug 16, 2023
  2. aronchanisme commented on Aug 16, 2023

    @aronchanisme
    Contributor

    As the test case is from @zhangxu19830126 , please kindly take a look.

  3. assigned and unassigned on Aug 19, 2023
  4. assigned and unassigned on May 23, 2024
  5. w-zr commented on May 23, 2024

    @w-zr
    Contributor

    fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/bugphase/testing

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions