Skip to content

Warnings about "closing unused connection" #859

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

Open
juliasilge opened this issue Mar 5, 2025 · 4 comments
Open

Warnings about "closing unused connection" #859

juliasilge opened this issue Mar 5, 2025 · 4 comments

Comments

@juliasilge
Copy link
Member

I have started seeing warnings about "closing unused connection" when I read/write pins:

Warning messages:
1: In for (i in seq_along(specs)) { :
  closing unused connection 8 (/private/var/folders/hv/hzsmmyk9393_m7q3nscx1slc0000gn/T/RtmpbFtlMX/file2ae6ad2a5fe.tar.gz)
2: In for (i in seq_along(specs)) { :
  closing unused connection 7 (/private/var/folders/hv/hzsmmyk9393_m7q3nscx1slc0000gn/T/RtmpbFtlMX/file2ae63b020860)
3: In for (i in seq_along(specs)) { :
  closing unused connection 6 (/private/var/folders/hv/hzsmmyk9393_m7q3nscx1slc0000gn/T/RtmpbFtlMX/file2ae67deb1895)
4: In for (i in seq_along(specs)) { :
  closing unused connection 4 (/private/var/folders/hv/hzsmmyk9393_m7q3nscx1slc0000gn/T/RtmpbFtlMX/file2ae66b0e648b.tar.gz)
@juliasilge
Copy link
Member Author

I looked at this a little today, and I believe this is only happening for pins on Connect and it's these local files in the temp directory that end up with connections that do not get closed:

pins-r/R/board_connect.R

Lines 293 to 294 in 45c1634

bundle_dir <- rsc_bundle(board, name, paths, metadata, x, preview_data = preview_data)
bundle_file <- fs::file_temp(ext = "tar.gz")

@juliasilge
Copy link
Member Author

The connections for files like filea970b3016d7 are getting opened here:

pins-r/R/board_connect.R

Lines 308 to 311 in 45c1634

json <- rsc_POST(
board, rsc_v1("content", content_guid, "bundles"),
body = httr::upload_file(bundle_file)
)

The connections for files like filea97019f844d7.tar.gz are getting opened here:

pins-r/R/board_connect.R

Lines 316 to 319 in 45c1634

json <- rsc_POST(
board, rsc_v1("content", content_guid, "deploy"),
body = list(bundle_id = bundle_id),
)

@juliasilge
Copy link
Member Author

@juliasilge
Copy link
Member Author

I think it's httr actually: r-lib/httr#761

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

No branches or pull requests

1 participant