You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When same urls are requested in some package functions and in package finalizer, curl handles cached in handle_pool become "dead", because curl handle finalizers are run before package finalizer.
Right now I just call httr::handle_reset() for each URL used in the finalizer, but I would prefer to have a more generic approach, because these URLs are called by some other packages internals and they may change in the future, breaking my package.
I think one of the following options could work:
have an option to not maintain handle_pool at all
have a function handle_pool_reset() to clear the whole pool
update httr::handle_find() to check if the handle is not dead before returning it (will require new curl::handle_is_dead() function)
update httr::handle_find() to add its own finalizer that would remove the url from the pool before the handle is cleared by curl
I can submit a pool request :), just not sure which approach would be preferred.
Thanks,
Oleh Khoma
The text was updated successfully, but these errors were encountered:
httr has been superseded in favour of httr2, so is no longer under active development. If this problem is still important to you in httr2, I'd suggest filing an issue offer there 😄. Thanks for using httr!
When same urls are requested in some package functions and in package finalizer, curl handles cached in
handle_pool
become "dead", because curl handle finalizers are run before package finalizer.Here is a reprex (put in a package)
Right now I just call
httr::handle_reset()
for each URL used in the finalizer, but I would prefer to have a more generic approach, because these URLs are called by some other packages internals and they may change in the future, breaking my package.I think one of the following options could work:
handle_pool
at allhandle_pool_reset()
to clear the whole poolhttr::handle_find()
to check if the handle is not dead before returning it (will require newcurl::handle_is_dead()
function)httr::handle_find()
to add its own finalizer that would remove the url from the pool before the handle is cleared by curlI can submit a pool request :), just not sure which approach would be preferred.
Thanks,
Oleh Khoma
The text was updated successfully, but these errors were encountered: