Repository navigation
Conversation
|
Ben, I verified locally that, as you mentioned, we have a leaked connection after the labkey.webdav.put. However, I applied your change locally and it results in the following error (and the connection still looks to be open): I'm looking into other approaches to close the connection. |
|
Odd - let me look into this. |
|
@cnathe: i have a more elegant solution to this. will push here later this morning. |
|
@cnathe, my last commit takes a different approach. I found this through gemini, and the corresponding stackoverflow post is in the comments. I did basic testing locally and this appears to solve the failure to close the connection. I dont think I'm able to kick off automated tests; however, those tests should do a good job of validating whether this solution preserves expected behaviors. |
|
@bbimber I pulled down these changes locally and tested. This does take care of the leaked connection, but it ends up changing what gets store on the server for me. A WebDAV PUT saves the whole request body as the file, so the multipart wrapper ends up in the file. I tested against a local server and got this result for a text file that just had "hello" in the file content:
|
|
OK, I will look into this closer tomorrow. |
|
Hi @cnathe: Thank you for your patience on this. I just tested my last commit more completely and this solution, while not especially elegant, does seem to work. You can test using setDebugMode(TRUE): |
|
Ben, sorry for the delay. I haven't had a chance to get back to this yet and test out the latest solution. I'll try to get to that soon and get back to you. |

Hi @cnathe and @labkey-klum: this is a small issue I noticed. Apparently httr does not always close open connections when uploading files. You can see this by trying to use labkey.webdav.put(), and then running "showConnections(all = TRUE)". This change should make labkey.webdav.put() clean up after itself.
According to google, httr2 is better about this. Migrating to httr2 probably wouldnt be that hard, but it would require some more updates across Rlabkey.