Skip to content

Fix leaked promise in pull - #530

Merged
koral-- merged 1 commit into
DeviceFarmer:masterfrom
dfriederich:fix_sync_pull
Sep 13, 2024
Merged

koral-- merged 1 commit into
DeviceFarmer:masterfrom
dfriederich:fix_sync_pull

Conversation

@dfriederich

Copy link
Copy Markdown

When pulling, the second adb sync transfer was just ignored, causing a warning to be logged for every pull operation.

2024-09-11T20:10:52.421Z root ERROR (node:174306) Warning: a promise was created in a handler at node:internal/async_hooks:130:17 but was not returned from it, see http://goo.gl/rRqMUw
at new Promise (/..../vendors-node_modules_drivelist_build_Release_drivelist_node-node_modules_devicefarmer_adbkit_-505406.js:50543:10)

Fixing this by actually returning the promise.

@koral--

koral-- commented Sep 12, 2024

Copy link
Copy Markdown
Member

Could you sync your branch? I've just fixed the CI config, so PR check should work.

When pulling, the second adb sync transfer was just ignored,
causing a warning to be logged for every pull operation.

2024-09-11T20:10:52.421Z root ERROR (node:174306) Warning: a promise was created in a handler at node:internal/async_hooks:130:17 but was not returned from it, see http://goo.gl/rRqMUw
    at new Promise (/..../vendors-node_modules_drivelist_build_Release_drivelist_node-node_modules_devicefarmer_adbkit_-505406.js:50543:10)

Fixing this by actually returning the promise.

Signed-off-by: Daniel Friederich <[email protected]>
@dfriederich

Copy link
Copy Markdown
Author

thanks for the validation setup fix :-)

@koral--
koral-- merged commit 75cd64f into DeviceFarmer:master Sep 13, 2024
@sunjw

sunjw commented Apr 27, 2025

Copy link
Copy Markdown

This cause memory leak again. And almost revert the effect in #315
You cannot make a readNext promise chain in the pull, because it will store all the pulled data in the memory. If you are pulling a 20GB file, then you will consume 20GB memory.

sunjw added a commit to sunjw/adbkit that referenced this pull request Apr 27, 2025
@dfriederich

Copy link
Copy Markdown
Author

reverting is also wrong, it does break functional behavior. E.g. cancellation, failure to report errors.

@sunjw

sunjw commented Apr 29, 2025 •

Copy link
Copy Markdown

Yes, this function need to fully refactor or the data need to be dropped from memory in the promise chain.
The revert is just a temporary workaround for my own needs.

sunjw added a commit to sunjw/adbkit that referenced this pull request Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants