Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

fnesveda
Copy link
Member

We can't use Actor.reboot() inside a migrating event handler, because it internally calls all the handlers for the migrating event, so calling that on the migrating event would get into an infinite loop. This fixes it by allowing the reboot to be called only once.

@fnesveda fnesveda added adhoc Ad-hoc unplanned task added during the sprint. t-core-services Issues with this label are in the ownership of the core services team. labels Dec 18, 2024
@fnesveda fnesveda added this to the 105th sprint - Platform Team milestone Dec 18, 2024
@fnesveda fnesveda requested review from B4nan and janbuchar December 18, 2024 12:42
@fnesveda fnesveda self-assigned this Dec 18, 2024
Copy link
Contributor

@janbuchar janbuchar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, @B4nan should probably see this as well

@fnesveda fnesveda merged commit 271bc99 into master Dec 19, 2024
9 checks passed
@fnesveda fnesveda deleted the fix/prevent-multiple-reboots branch December 19, 2024 15:04
fnesveda added a commit to apify/apify-sdk-python that referenced this pull request Dec 20, 2024
…oot behavior with JS SDK (#361)

This fixes several issues with the `Actor.reboot()` behavior:
- `Actor.reboot()` waits for all event handlers to finish, but if itself
it was called in an event handler, it would be waiting for itself,
getting into a deadlock
- `Actor.reboot()` in the JS SDK triggers event handlers for the
`migrating` and `persistState` events, but in the Python SDK it was
triggering only the `persistState` handlers

This aligns the behavior to work like the JS SDK, and prevents reboot
getting into an infinite loop by allowing it to be called only once.

Related PR in JS SDK: apify/apify-sdk-js#345
@fnesveda fnesveda added the validated Issues that are resolved and their solutions fulfill the acceptance criteria. label Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. t-core-services Issues with this label are in the ownership of the core services team. validated Issues that are resolved and their solutions fulfill the acceptance criteria.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.