Skip to content

Fix for 'all connections are in use' when calling read.markup.RCC() on multiple files.#1

Open
chrisrgc wants to merge 1 commit intocran:masterfrom
chrisrgc:master
Open

Fix for 'all connections are in use' when calling read.markup.RCC() on multiple files.#1
chrisrgc wants to merge 1 commit intocran:masterfrom
chrisrgc:master

Conversation

@chrisrgc
Copy link
Copy Markdown

Package Version: NanoStringNorm 1.2.0
R Version: 3.3.2
OS: Windows 10 x64

When loading a series of 144 raw Nanostring RCC files using NanoStringNorm::read.markup.RCC(), processing of the 32nd file fails with the error:

 Error in textConnection(as.character(sample.info$text)) :
  all connections are in use

...when creating the sample.con textConnection (https://github.com/cran/NanoStringNorm/blob/1.2.0/R/read.markup.RCC.R#L55)

help("connections", package="base") states that the maximum number of allocated connections is 128 (with 3 reserved for stdin, stdout, stderr) and I can see that read.markup.RCC() is opening textConnections but not closing them and hitting the hard limit of 125 usable connections.

As each call to read.markup.RCC() opens 4 connections, all 125 available will be allocated by the time sample.con is created on the 32nd iteration.

Simply closing the connection once the data has been read from the file resolves this problem.

…() to avoid exhausting the 125 user allocatable connections.
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

Successfully merging this pull request may close these issues.

1 participant