ropensci / elastic

R client for the Elasticsearch HTTP API
https://docs.ropensci.org/elastic
Other
245 stars 58 forks source link

Running R for a long period results in connection failing after a while with error #266

Closed creiche closed 4 years ago

creiche commented 4 years ago

We are running a service using Rserve that write out to Elastic. After running for about a day we start getting these errors when trying to write to Elastic:

Error in file(con, "w") : cannot open the connection

  | In addition: Warning message:   | In file(con, "w") :   | cannot open file '/tmp/RtmpcyjRf4/elastic__4e86542674e': No such file or directory

This is how we are connecting and writing to elastic:

es<-elastic::connect(host = ELASTIC_ENDPOINT,port = '9200')

response<-invisible(elastic::docs_bulk(es, x = final_data ,index = 'nrt' ,type = 'docs' ,doc_ids = final_data[,id:=paste0(userId,cust_nbr,co_nbr,SiteId,rank)]$id ,es_ids = F))

sckott commented 4 years ago

thanks for the issue. Please share your R session info as requested and your Elasticsearch version.

I'm guessing it's not possible, but can you run traceback() after you see that error?