Bugs

19 views
Skip to first unread message

Joel

unread,
Sep 29, 2010, 3:29:34 AM9/29/10
to r-node-users
In this post Ill post all the bugs I find.

If the idleSession timer has gone out but you havent closed the window
and then try to do an R command the server crashes with this error
msg:

29 Sep 09:27:45 - (local): Removing session
33a5cae2600bc975c115a93d8198be846713840b0a20755e3adc4bd413da67dd

/home/joel/Hämtningar/r-node-r-node/deploy/r-node.js:113
sessions[s].Rconnection.close();
^
TypeError: Cannot call method 'close' of undefined
at /home/joel/Hämtningar/r-node-r-node/deploy/r-node.js:113:33
at Array.forEach (native)
at cleanOutSessions (/home/joel/Hämtningar/r-node-r-node/deploy/r-
node.js:110:14)
at Server.requestMgr (/home/joel/Hämtningar/r-node-r-node/deploy/r-
node.js:200:5)
at Server.emit (events:27:15)
at HTTPParser.onIncoming (http:831:10)
at HTTPParser.onHeadersComplete (http:87:31)
at Stream.ondata (http:763:22)
at IOWatcher.callback (net:494:29)
at node.js:757:9


Jamie Love

unread,
Sep 30, 2010, 5:40:24 AM9/30/10
to r-node...@googlegroups.com
Hi Josh,

I've just pushed a commit to the git repository that solves this problem, and a few other problems with authenticated users.

Regards
Jamie
--
Jamie Love
Looking for custom software development? Contact us at www.nsquaredsoftware.com.

Joel

unread,
Sep 30, 2010, 6:45:21 AM9/30/10
to r-node-users
pffff Im not josh :P (whoever that is)

But got an other can be bug don't know or its two perhaps

When trying to visualize a large data.frame (talking 500+ rows 10+
colums) or set I dont get all the colums printed out I think I get the
8 first or something
and thats when I just write the name of the variable that contains the
data.frame

The other one is if I try to visualize a big part of my data.frame by
doing

DF[1:9] (for example, display the first 9 colums with all the rows)

The machine eats up all my RAM and "crashes" so to say this problem
can be as much due to Rserve or R-node don't know witch one.

//Joel

Joel

unread,
Sep 30, 2010, 7:00:05 AM9/30/10
to r-node-users
Just got a new one :)
It might have something todo with the above things as I get this error
msg after Ive done the first "bug" above.

"Ett skript på den här sidan kan vara upptaget, eller ha slutat att
svara.

Skript: http://localhost:2903/js/extjs/ext-all.js:7"

And now to the translation :)

"A script on this site can be preoccupied, or stoped answering.

Script: http://localhost:2903/js/extjs/ext-all.js:7"

And now you can learn some Swedish words when you wake up as its 11h+
for you so its 23.00 at your place I guess.

Sweet dreams

//Joel

Joel

unread,
Sep 30, 2010, 7:12:59 AM9/30/10
to r-node-users
Sorry for alot of post now as all of the dose today could have been in
one.

One more thing on the first of the display things, after that command
do show the hole dataset my browser starts to use ALOT more of my CPU
(but not continuously, just when I try to do something) so it feels
like its in a Catch-22 state so to say.
Using Firefox 3.6.10

//Joel

Joel

unread,
Oct 1, 2010, 7:12:49 AM10/1/10
to r-node-users
From the latest git release i get this error when trying to use
barplot:

1 Oct 13:11:42 - 127.0.0.1: Executing R command: 'barplot(x)'
1 Oct 13:11:42 - 127.0.0.1: R command 'barplot(x)' is graphical.
Wrapping in graphics mechanism.
[1] "ok"
DEBUG: requestMgr: No sid. cannot continue.
DEBUG: requestMgr: No sid. cannot continue.

And a blank site opens where there should be a graph with a broken
paper icon in the top left corner.

//Joel

Jamie Love

unread,
Oct 1, 2010, 7:47:37 AM10/1/10
to r-node...@googlegroups.com
Thanks Joel for all the feedback,

and my apologies for calling you Josh - my brain wasn't watching my fingers.

I'm tracking all of these, so won't forget them. 

I'm being sent overseas for business and so may be somewhat distracted over the next week and a half.  I'll get back to these asap though.

Kind regards,
Jamie

Jamie Love

unread,
Oct 1, 2010, 8:07:22 AM10/1/10
to r-node...@googlegroups.com
Hi Joel,

The data is all sent from the server to the client, but I didn't think I did much with it. It seems though that I am. Maybe I'm storing it in a variable of some kind.

If you have Google Chrome available to try, I'd be interested in hearing what happens with that.

I tried:

x <- array(1:5000, dim=c(500,10))
x

and it printed the 5000 values out fine for me, with no noticeable slowdown, but I'm not certain I'm capturing quite the same situation you're having.


I'll have a proper look when I get a chance.

Jamie Love

unread,
Oct 4, 2010, 4:56:39 AM10/4/10
to r-node...@googlegroups.com
Hi Joel,

This was a rather big problem in the end - no server side graphs worked!  Sorry if this has held you up, I didn't realise the extent of the problem.

I've pushed a fix to the gitorious repository for you.

Jamie

Joel

unread,
Oct 4, 2010, 7:15:20 AM10/4/10
to r-node-users
Thx for the fixes will try em out and see what more I can find, will
be doing some stress tests soon :) but Im guessing it will be more of
a test of the capacity of Rserve then on R-node.

Have a nice day

//Joel

Joel

unread,
Oct 4, 2010, 8:42:39 AM10/4/10
to r-node-users
Ive been trying to fix the handle of large data.frames by sending them
through a R script that takes out small parts at the time from the
data given, It works fine when running directly under R but when I run
it in R-node I only get the last print so to say.

R-script (or its 2):
revtrunc <- function(x) { x - floor(x) }
displayData <- function(data, maxCol=5, maxRow=100){
if(ncol(data)>maxCol){
bla <- 0
blaSlut<-floor(ncol(data)/maxCol)
print(blaSlut)
blaDec<-revtrunc(ncol(data)/maxCol)
print(blaDec)
while(bla<blaSlut){
fc<- (1+(maxCol*bla))
lc<-maxCol+(maxCol*bla)
print(data[fc:lc])
bla<-bla+1
}
fc<-ncol(data)-(round(maxCol*blaDec)-1)
print(data[fc:ncol(data)])
}
else {
print(data)
}
}

These scripts can probably be written better but I just wanted to try
the concept so to say.

//Joel

Joel

unread,
Oct 5, 2010, 7:36:38 AM10/5/10
to r-node-users
Ive been trying to figure out whats going on when my server eats all
the RAM and crashes as described before but can make a small recall of
when:

When trying to extract data from the database example command rs <-
dbGetQuery(con, "SELECT * from patient;")
When trying to display that data in this case rs (when i load the data
in small pieces with help of an R script Ive written (appendix A)

So now you may think this isent an R-node problem but an Rserve
problem (at least that was what I was thinking) so I build a small
java program that executed the first of these two and nothing bad
happened it worked...
This made me to believe that it has something to do with the R-node <--
> Rserve interaction thats not working at this special case.
Cuz as you proven its not about printing large amount of data its
about my kind of data (mix of numbers and strings and dates and all
kind of strange things)

I'm not sure what I can do to more pin-point whats going on between R-
node and R-serve at the time of these commands.

If you have any idea please tell me cuz this problem seems like a one
of a kind sort of thing and needs to be solved.

//joel

Apendix A

require(RMySQL)
drv =dbDriver("MySQL")
con <- dbConnect(drv, user='HIDDEN', dbname='REMOVED',
host="127.0.0.1", password='REMOVED', client.flag =
CLIENT_MULTI_STATEMENTS)

script <- paste("SELECT * from A", "SELECT * from B", "SELECT * from
C;", sep = ";")

rs <- dbSendQuery(con, script)

db.A<-NULL
db.B<-NULL
db.C<-NULL
whatQ<-0
repeat{
while(!dbHasCompleted(rs)){
if(whatQ==0){
db.A<-rbind(db.A,fetch(rs,n=51))
}
if(whatQ==2){
db.B<-rbind(db.B,fetch(rs,n=51))
}
if(whatQ==1){
db.C<-rbind(db.C,fetch(rs,n=51))
}
}
whatQ=whatQ+1;
if(dbMoreResults(con)){
rs <- dbNextResult(con)
}
else{
break
}

}
dbDisconnect(con)
dbUnloadDriver(drv)
remove(script)
remove(whatQ)
remove(rs)
remove(drv)
remove(con)
Reply all
Reply to author
Forward
0 new messages