Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when using runTask in a re-entrant way #48235

Closed
wants to merge 1 commit into from

Conversation

javache
Copy link
Member

@javache javache commented Dec 12, 2024

Summary:
Recursively calling runTask is not supported, as the inner call will no-op since we're already executing the eventloop.

Currently errors are not correctly propagated, but this at least makes it so that we don't attempt to schedule the task either, which could lead to incorrect assumptions being made.

Changelog: [internal]

Reviewed By: rubennorte

Differential Revision: D67107664

Summary:
Recursively calling runTask is not supported, as the inner call will no-op since we're already executing the eventloop.

Currently errors are not correctly propagated, but this at least makes it so that we don't attempt to schedule the task either, which could lead to incorrect assumptions being made.

Changelog: [internal]

Reviewed By: rubennorte

Differential Revision: D67107664
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Dec 12, 2024
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D67107664

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in c06f13e.

@javache javache deleted the export-D67107664 branch December 12, 2024 20:28
rubennorte added a commit to rubennorte/react-native that referenced this pull request Dec 16, 2024
Summary:
Changelog: [internal]

We recently prevented tasks that run via `runTask` to synchronously call `runTask` because the execution is synchronous and we can't nest tasks in the event loop (D67107664 / facebook#48235).

This adds `scheduleTask` to schedule tasks (also within tasks) with the right expectations (the task will not run synchronously on that call but at the right time).

It also adds `runWorkLoop` so we can run scheduled tasks if they're not scheduled from an already running task.

Differential Revision: D67275518
rubennorte added a commit to rubennorte/react-native that referenced this pull request Dec 16, 2024
Summary:

Changelog: [internal]

We recently prevented tasks that run via `runTask` to synchronously call `runTask` because the execution is synchronous and we can't nest tasks in the event loop (D67107664 / facebook#48235).

This adds `scheduleTask` to schedule tasks (also within tasks) with the right expectations (the task will not run synchronously on that call but at the right time).

It also adds `runWorkLoop` so we can run scheduled tasks if they're not scheduled from an already running task.

Differential Revision: D67275518
rubennorte added a commit to rubennorte/react-native that referenced this pull request Dec 16, 2024
Summary:

Changelog: [internal]

We recently prevented tasks that run via `runTask` to synchronously call `runTask` because the execution is synchronous and we can't nest tasks in the event loop (D67107664 / facebook#48235).

This adds `scheduleTask` to schedule tasks (also within tasks) with the right expectations (the task will not run synchronously on that call but at the right time).

It also adds `runWorkLoop` so we can run scheduled tasks if they're not scheduled from an already running task.

Differential Revision: D67275518
rubennorte added a commit to rubennorte/react-native that referenced this pull request Dec 16, 2024
Summary:

Changelog: [internal]

We recently prevented tasks that run via `runTask` to synchronously call `runTask` because the execution is synchronous and we can't nest tasks in the event loop (D67107664 / facebook#48235).

This adds `scheduleTask` to schedule tasks (also within tasks) with the right expectations (the task will not run synchronously on that call but at the right time).

It also adds `runWorkLoop` so we can run scheduled tasks if they're not scheduled from an already running task.

Differential Revision: D67275518
facebook-github-bot pushed a commit that referenced this pull request Dec 16, 2024
Summary:
Pull Request resolved: #48284

Changelog: [internal]

We recently prevented tasks that run via `runTask` to synchronously call `runTask` because the execution is synchronous and we can't nest tasks in the event loop (D67107664 / #48235).

This adds `scheduleTask` to schedule tasks (also within tasks) with the right expectations (the task will not run synchronously on that call but at the right time).

It also adds `runWorkLoop` so we can run scheduled tasks if they're not scheduled from an already running task.

Reviewed By: javache

Differential Revision: D67275518

fbshipit-source-id: acde0093802fbcb7083334f2c0247b37b759a6b1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. p: Facebook Partner: Facebook Partner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants