-
Notifications
You must be signed in to change notification settings - Fork 261
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
xml2::xml_add_parent breaks under small stress. #803
Comments
I believe you are seeing an RStudio error: Are you able to reproduce without RStudio? |
Yes I got it from a docker container initially I use in a remote VM. Just used Rstudio to make a minimal example. Reproducing from a terminal in my local machine.
library(plumber)
library(xml2)
#* Add parent to xml - destructive operation
#* @get /echo
function() {
x <- read_xml("<fruits><apple color='red'></apple></fruits>")
xml_add_parent(x, read_xml("<food></food>"))
print(as.character(x))
}
Things work ok until I 'speed up' clicking. I get this behavior in the remote server as well. |
Actually, it looks like an xml2 error library(plumber)
library(xml2)
xx <- function() {
x <- read_xml("<fruits><apple color='red'></apple></fruits>")
xml_add_parent(x, read_xml("<food></food>"))
print(as.character(x))
}
for(i in 1:1000)xx() produces the same error. |
System details
Output of
sessioninfo::session_info()()
:Hello, I have run into the following issue.
If I add a parent node in xml2 and consecutively run many requests fast, then I fall into a memory issue.
I can work around this by using
xml_add_child
and 2-3 more lines of code for now, but it looks like a bug forplumber
and destructive xml operators.Thank you for maintaining plumber.
The text was updated successfully, but these errors were encountered: