[Rd] CRAN task views work only once per session (PR#9330)

From: Keith Ponting <k.ponting_at_aurix.com>
Date: Mon 06 Nov 2006 - 11:23:59 GMT


Thankyou to those who have replied to this thread.

I have now reproduced similar effects in a way which does not directly involve CRAN task views. (I have also reproduced the original problem on a different machine within
our site and using a different mirror.)

The following sequence of commands works repeatedly within plain Rterm (actually running under XEmacs) on Windows XP:

x<-url("http://www.sourcekeg.co.uk/cran/src/contrib/Views.rds",open="rb" );
showConnections()
.readRDS(x);
showConnections()
close(x)
showConnections()

However under RGui on the same system, second and subsequent attempts time out in .readRDS (see session log below) and note that although the connection is shown as open immediately before the second .readRDS call, it is shown as closed immediately after that (failing) call.

I wonder whether something in RGui is holding on to connections after they have been closed. Even while .readRDS is timing out in one RGui session, I can run that sequence of calls in plain Rterm or (once!) in another RGui session without problems, which I hope eliminates the possibility that it is our company firewall or something else on my PC holding on to the connection in some way.

R version 2.4.0 (2006-10-03)
Copyright (C) 2006 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R.

>

x<-url("http://www.sourcekeg.co.uk/cran/src/contrib/Views.rds",open="rb" );
> showConnections()

  description                                             class mode
text
3 "http://www.sourcekeg.co.uk/cran/src/contrib/Views.rds" "url" "rb" "binary"
  isopen can read can write
3 "opened" "yes" "no"
> .readRDS(x);
> showConnections()
  description                                                    class
mode
3 "gzcon(http://www.sourcekeg.co.uk/cran/src/contrib/Views.rds)" "gzcon" "rb"
  text     isopen   can read can write
3 "binary" "opened" "yes"    "no"     

> close(x)
> showConnections()

     description class mode text isopen can read can write
>

x<-url("http://www.sourcekeg.co.uk/cran/src/contrib/Views.rds",open="rb" );
> showConnections()

  description                                             class mode
text
3 "http://www.sourcekeg.co.uk/cran/src/contrib/Views.rds" "url" "rb" "binary"
  isopen can read can write
3 "opened" "yes" "no"
> .readRDS(x);

Error in .readRDS(x) : connection is not open In addition: Warning message:
InternetOpenUrl failed: 'The operation timed out'
> showConnections()

     description class mode text isopen can read can write
> close(x)
> showConnections()

     description class mode text isopen can read can write
>

x<-url("http://www.sourcekeg.co.uk/cran/src/contrib/Views.rds",open="rb" );
> showConnections()

  description                                             class mode
text
3 "http://www.sourcekeg.co.uk/cran/src/contrib/Views.rds" "url" "rb" "binary"
  isopen can read can write
3 "opened" "yes" "no"
> .readRDS(x);

Error in .readRDS(x) : connection is not open In addition: Warning message:
InternetOpenUrl failed: 'The operation timed out'
> showConnections()

     description class mode text isopen can read can write
> close(x)
> showConnections()

     description class mode text isopen can read can write
>
> sessionInfo()

R version 2.4.0 (2006-10-03)
i386-pc-mingw32

locale:
LC_COLLATE=English_United Kingdom.1252;LC_CTYPE=English_United Kingdom.1252;LC_MONETARY=English_United
Kingdom.1252;LC_NUMERIC=C;LC_TIME=English_United Kingdom.1252

attached base packages:
[1] "methods" "stats" "graphics" "grDevices" "utils" "datasets"
[7] "base"
>

If I remove the .readRDS(x) call, there is no problem - the following command sequence does work repeatedly:
x<-url("http://www.sourcekeg.co.uk/cran/src/contrib/Views.rds",open="rb" );
showConnections()
close(x)
showConnections()

Dr. Keith Ponting
Principal Scientist

Aurix Ltd
Malvern Hills Science Park
Geraldine Rd Malvern Worcestershire WR14 3SZ UK



This email has been scanned by the MessageLabs Email Security System. For more information visit http://www.virtual-email.net/messagelabs.htm

R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Mon Nov 06 22:27:54 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 07 Nov 2006 - 03:30:34 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.