Skip to content

process_read hung  #57

Open
Open
@DSXiangLi

Description

@DSXiangLi

Hi Lukasz,

Thanks for this amazing package! It has been of great help!

I recently ran into a problem when calling process_read, see below

 handle <- try( spawn_process(R_command, argument = argument), silent = T)

 message <- process_read(handle,  pipe = PIPE_STDERR,  timeout = 1000 ,flush = TRUE)

if(length(message)!=0){
        cat(message,'\n', file= log_con)
}

Basically I am calling another Rscript that contains a while loop reading from database and printing all the queries. And I want to log all these queries into my log file - log_con.

However whenever I reach about 450 lines of queries, process_read stops returning result. When I check process_state(handle), it shows the script is still running.

The Rscript is working fine independently. Any idea what may cause this?

And is there an easier way to write the process_read into a log file, like python function

subprocess.check_call(command, stdout=log, stderr=log, shell=True, env=rscript_env)

Many thanks!

Sandy

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions