-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #268 from temporalio/hotfix/add-gc: fix memory lea…
…k when a workflow with an active internal timer is destroyed - Fixed memory leaks in the case when an uncompleted workflow with an active internal timer (see awaitWithTimeout) is destroyed. - Call `gc_collect_cycles()` after each Workflow destroy. - Remove the `WorkflowContext::$timers` collection. Ut is unnecessary since Temporal PHP SDK 2.0 . - Remove the `WorkflowContext::$asyncAwaits` collection because it is unnecessary. - Remove unused $loop parameter from the `Temporal\Internal\Transport\Client` constructor. - Other small improvements.
- Loading branch information
Showing
13 changed files
with
305 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
tests/Fixtures/src/Workflow/AwaitWithSingleTimeoutWorkflow.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of Temporal package. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Temporal\Tests\Workflow; | ||
|
||
use Temporal\Workflow; | ||
use Temporal\Workflow\WorkflowMethod; | ||
|
||
#[Workflow\WorkflowInterface] | ||
class AwaitWithSingleTimeoutWorkflow | ||
{ | ||
#[WorkflowMethod()] | ||
public function handler() | ||
{ | ||
yield Workflow::await(Workflow::timer(5000)); | ||
|
||
return 'ok'; | ||
} | ||
} |
Oops, something went wrong.