clients repeatedly disconnecting / reconnecting

70 views
Skip to first unread message

Bill Walton

unread,
Oct 25, 2011, 11:48:50 PM10/25/11
to juggernaut...@googlegroups.com
Hi,

I'm working on a Rails 3.1 chat-type app and I'm seeing a couple of
things I need some advice on.

First, it taking what seems to me to be a long (5+ seconds) period of
time for a client to get subscribed. Is that normal?

Second, clients are getting disconnected with regularity. I've pasted
some logging from Juggernaut below. The output represents 2 clients
sitting 'idle' wrt user intervention.

Any help understanding this behavior and advice on how I might go
about 'correcting' it would be very much appreciated.

TIA,
Bill

25 Oct 22:27:54 - Initializing client with transport "xhr-polling"
25 Oct 22:27:54 - Client 24299525143578649 connected
25 Oct 22:27:54 - Received: {"type":"subscribe","channel":"/chat/7"}
25 Oct 22:27:54 - Client subscribing to: /chat/7
25 Oct 22:28:02 - Client 6432006370741874 disconnected
25 Oct 22:30:00 - Initializing client with transport "xhr-polling"
25 Oct 22:30:00 - Client 12582906801253557 connected
25 Oct 22:30:00 - Received: {"type":"subscribe","channel":"/chat/7"}
25 Oct 22:30:00 - Client subscribing to: /chat/7
25 Oct 22:30:07 - Client 24299525143578649 disconnected
25 Oct 22:32:05 - Initializing client with transport "xhr-polling"
25 Oct 22:32:05 - Client 7235994231887162 connected
25 Oct 22:32:05 - Received: {"type":"subscribe","channel":"/chat/7"}
25 Oct 22:32:05 - Client subscribing to: /chat/7
25 Oct 22:32:13 - Client 12582906801253557 disconnected
25 Oct 22:34:11 - Initializing client with transport "xhr-polling"
25 Oct 22:34:11 - Client 3601086374837905 connected
25 Oct 22:34:11 - Received: {"type":"subscribe","channel":"/chat/7"}
25 Oct 22:34:11 - Client subscribing to: /chat/7

bill walton

unread,
Oct 28, 2011, 10:06:38 PM10/28/11
to Juggernaut 2
Bump, please!

I would really like to understand what's causing the connect-
>disconnect->reconnect->disconnect->... behavior and what I need to do
to cause the client to stay connected. Please let me know what
additional information is needed if it is.

Thanks!
Bill

Alex MacCaw

unread,
Oct 29, 2011, 8:49:59 AM10/29/11
to juggernaut...@googlegroups.com
Hmm, that's a bit weird. What browsers are you using? What version of Juggernaut and Socket.io are you using?

--
You received this message because you are subscribed to the Google Groups "Juggernaut 2" group.
To post to this group, send email to juggernaut...@googlegroups.com.
To unsubscribe from this group, send email to juggernaut-for-r...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/juggernaut-for-rails?hl=en.




--
Alex MacCaw

+12147175129
@maccman

http://alexmaccaw.co.ukhttp://www.leadthinking.com | http://socialmod.com

Bill Walton

unread,
Oct 29, 2011, 10:09:25 AM10/29/11
to juggernaut...@googlegroups.com
Hi Alex,

Thanks very much for your reply. I appreciate it.

The example I posted was with one client on FF 3.6.23 and the other on
Chrome 15.0.874.106. Socket.io is at 0.7.9. The browsers were
running on the same machine as the app which is Rails 3.1 on top of
Ruby 1.9.2. The only additional piece of information I can think of
that may be relevant is that the clients are also using the jQuery
countdown timer plugin. I mention it because it occurred to me last
night that perhaps the countdown timer might be somehow 'getting in
the way' of Juggernaut and causing a timeout, but that's an uninformed
hypothesis.

Best regards,
Bill

BTW, I'm probably going to be bothering you over on the Spine list soon too. ;-)

Alex MacCaw

unread,
Oct 29, 2011, 10:11:49 AM10/29/11
to juggernaut...@googlegroups.com
Cool, no worries. That's an ancient socket.io - have you tried using the latest Juggernaut first?

Alex

Bill Walton

unread,
Oct 29, 2011, 10:15:20 AM10/29/11
to juggernaut...@googlegroups.com
I didn't realize I was behind. I'll grab latest and report back soon.

Thanks,
Bill

Bill Walton

unread,
Oct 29, 2011, 7:25:24 PM10/29/11
to juggernaut...@googlegroups.com
So... I gotta believe I've got a screwed up configuration.

wildbill@wildbill-hp-laptop:/$ sudo find -name socket.io
./usr/local/lib/node_modules/juggernaut/node_modules/socket.io
./usr/local/lib/node_modules/juggernaut/node_modules/socket.io/lib/socket.io
./home/wildbill/.npm/socket.io
./home/wildbill/.npm/socket.io/0.6.18/package/lib/socket.io
./home/wildbill/.rvm/gems/ruby-1.9.2-p290@chat/bundler/gems/juggernaut-6085a3497efb/vendor/socket.io
./home/wildbill/node_modules/socket.io

Which of these is _supposed_ to be there? And, by extension, which
should I update?

Thanks,
Bill

Bill Walton

unread,
Oct 31, 2011, 1:04:02 AM10/31/11
to juggernaut...@googlegroups.com
Alex,

Does this look normal? Or like part of the problem? I was pretty
sure I got the installation right, but this gives me pause.

Thanks,
Bill

Alex MacCaw

unread,
Oct 31, 2011, 5:16:32 AM10/31/11
to juggernaut...@googlegroups.com
Bill, sorry the slow reply. Yes, looks all normal - npm has this crazy thing where it doesn't share libraries. Did you find out what version of Juggernaut you were using?

gem list juggernaut

Bill Walton

unread,
Oct 31, 2011, 9:37:46 AM10/31/11
to juggernaut...@googlegroups.com
Hi Alex,

The Gemfile is pulling it from github. The "gem list" command doesn't
show it installed but "bundle show" tells me it's using 2.0.1. I was
a little surprised with the "gem list" result. Have only been using
RVM for a couple of months and jugggernaut is the only gem being
pulled into the mix in this way (gem 'juggernaut', :git =>
'git://github.com/maccman/juggernaut.git'). Do I need to do a "gem
install" for it?

Thanks,
Bill

PS. I saw on your blog that you're headed to NYC. If you decide
you'd like to see some of Texas, shoot me a note. I'd be very happy
to get you 'pointed.'

Alex MacCaw

unread,
Oct 31, 2011, 9:42:50 AM10/31/11
to juggernaut...@googlegroups.com
Yes, few things:

1. Pulling it in from GithHub like that won't work
2. That's the client, not the server (my bad, I asked the wrong thing)

What version is the server? Run:

npm info juggernaut

Thanks for the invite! Usually at SXSW, maybe see you there next year.

Bill Walton

unread,
Oct 31, 2011, 9:59:21 AM10/31/11
to juggernaut...@googlegroups.com
npm reports 2.0.9 (entire response pasted in below. I'll do a gem
install and change the Gemfile later today (probably this evening) and
report back.

SXSW isn't too far off. If your flight plan takes you through DFW,
let me know. Depending on schedules, maybe I can pick you up drive
you down. The most direct route down the Interstate highway doesn't
have much to recommend it in terms of scenery, but a slightly longer
route gets you there through the Texas Hill Country.

Bill Walton

unread,
Oct 31, 2011, 10:00:38 AM10/31/11
to juggernaut...@googlegroups.com
forgot to paste in the npm response.

wildbill@wildbill-hp-laptop:~/rails_apps/penny_auction$ npm info juggernaut
{ name: 'juggernaut',
description: 'Realtime PubSub server push.',
'dist-tags': { latest: '2.0.9' },
versions:
[ '2.0.0',
'2.0.1',
'2.0.2',
'2.0.3',
'2.0.4',
'2.0.5',
'2.0.6',
'2.0.7',
'2.0.8',
'2.0.9' ],
maintainers: 'maccman <mac...@gmail.com>',
author: 'maccman',
repository:
{ type: 'git',
url: 'git://github.com/maccman/juggernaut.git' },
time:
{ '2.0.0': '2011-03-23T21:34:41.793Z',
'2.0.1': '2011-03-23T21:34:41.793Z',
'2.0.2': '2011-03-23T21:45:53.367Z',
'2.0.3': '2011-03-30T00:51:40.453Z',
'2.0.4': '2011-04-04T23:30:21.967Z',
'2.0.5': '2011-05-16T21:48:56.966Z',
'2.0.6': '2011-09-21T18:00:31.218Z',
'2.0.7': '2011-09-21T22:14:19.189Z',
'2.0.8': '2011-09-27T20:47:42.979Z',
'2.0.9': '2011-09-28T12:31:16.296Z' },
version: '2.0.9',
licenses:
{ type: 'MIT',
url: 'https://github.com/maccman/juggernaut/blob/master/LICENSE' },
engine: 'node >=0.1.102',
main: './index',
bin: { juggernaut: './server.js' },
dependencies:
{ 'socket.io': '=0.8.4',
redis: '=0.6.6',
'node-static-maccman': '~0.5.3',
optimist: '~0.2.3' },
scripts: { start: 'node server.js' },
devDependencies: {},
engines: { node: '*' },
dist:
{ shasum: 'fffb430b8a00521ce0fbbc3f85a55444a6e01bbb',
tarball: 'http://registry.npmjs.org/juggernaut/-/juggernaut-2.0.9.tgz' },
directories: {} }

Alex MacCaw

unread,
Oct 31, 2011, 10:24:22 AM10/31/11
to juggernaut...@googlegroups.com
I've just pushed a new version of Juggernaut that should fix your issues :) - 2.1.0

Bill Walton

unread,
Oct 31, 2011, 10:28:11 AM10/31/11
to juggernaut...@googlegroups.com
Awesome! I'll pull it tonight and report back.

Thank you, Alex!
Bill

Bill Walton

unread,
Nov 1, 2011, 12:00:38 AM11/1/11
to juggernaut...@googlegroups.com
Hi Alex,

I just got a few minutes (forgot tonight was Halloween) and have some
strange (to me) news to report.

I modified the Gemfile (substituting '~> 2.1.0' for the git string),
installed the gem, and thought I'd 'fire it up' and see if the new
version fixed the issue I was having. So I did what I always do.
Opened a terminal and started redis. Opened another and started
juggernaut. Oops. "juggernaut: command not found." Hmmm. Oh hell.
I installed the gem but not the new version of juggernaut. npm
install -g juggernaut. npm: command not found. Hmmm. It's late so
I'm not going to dig into it tonight. I've still got a working
version on the laptop that I can use for comparison. If you've got
any ideas re: what I might have done wrong or what I might be missing,
please let me know.

Thanks,
Bill

bill walton

unread,
Nov 6, 2011, 11:28:07 AM11/6/11
to Juggernaut 2
Hi Alex,

Do you have any idea why changing the Gemfile to take out the pull
from github and installing the gem locally (without upgrading
juggernaut itself) would cause node, npm, and juggernaut to be
unreachable? On the laptop I get expected result from juggernaut -
help, node -v, and npm -ls. On the workstation that i made the change
on, i get unknown command. I'd really like to get this fixed rather
than do a complete rebuild if possible. My first guess was a PATH
problem but the only real diff is that the workstation has parhs to
specific rvm gemsets. The result of echo $PATH on the laptop is
below. I'll update this with the one from the workstation in a few
minutes.

Thanks much!
Bill

------------- output on laptop --------------

wildbill@wildbill-hp-laptop:~$ juggernaut -help
usage: juggernaut [options]

Starts a juggernaut server using the specified command-line options

options:
--port PORT Port that the proxy server should run on
--silent Silence the log output
-h, --help You're staring at it
wildbill@wildbill-hp-laptop:~$ node -v
v0.4.11
wildbill@wildbill-hp-laptop:~$ npm ls
/home/wildbill
└─┬ sock...@0.7.9
├── polic...@0.0.4
├── re...@0.6.6
└─┬ socket.i...@0.7.9
├── ugli...@1.0.6
├── websocke...@1.0.0
└── xmlhttp...@1.2.2

wildbill@wildbill-hp-laptop:~$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/
games:/home/wildbill/.rvm/bin



On Oct 31, 10:00 pm, Bill Walton <bwalton...@gmail.com> wrote:
> Hi Alex,
>
> I just got a few minutes (forgot tonight was Halloween) and have some
> strange (to me) news to report.
>
> I modified the Gemfile (substituting '~> 2.1.0' for the git string),
> installed the gem, and thought I'd 'fire it up' and see if the new
> version fixed the issue I was having.  So I did what I always do.
> Opened a terminal and started redis.  Opened another and started
> juggernaut.  Oops.  "juggernaut: command not found."  Hmmm.  Oh hell.
> I installed the gem but not the new version of juggernaut.  npm
> install -g juggernaut.  npm: command not found.  Hmmm.  It's late so
> I'm not going to dig into it tonight.  I've still got a working
> version on the laptop that I can use for comparison.  If you've got
> any ideas re: what I might have done wrong or what I might be missing,
> please let me know.
>
> Thanks,
> Bill
>
> On Mon, Oct 31, 2011 at 9:28 AM, Bill Walton <bwalton...@gmail.com> wrote:
> > Awesome!  I'll pull it tonight and report back.
>
> > Thank you, Alex!
> > Bill
>
> > On Mon, Oct 31, 2011 at 9:24 AM, Alex MacCaw <macc...@gmail.com> wrote:
> >> I've just pushed a new version of Juggernaut that should fix your issues :)
> >> - 2.1.0
>
> >> On Mon, Oct 31, 2011 at 2:00 PM, Bill Walton <bwalton...@gmail.com> wrote:
>
> >>> forgot to paste in the npm response.
>
> >>> wildbill@wildbill-hp-laptop:~/rails_apps/penny_auction$ npm info
> >>> juggernaut
> >>> { name: 'juggernaut',
> >>>  description: 'Realtime PubSub server push.',
> >>>  'dist-tags': { latest: '2.0.9' },
> >>>  versions:
> >>>   [ '2.0.0',
> >>>     '2.0.1',
> >>>     '2.0.2',
> >>>     '2.0.3',
> >>>     '2.0.4',
> >>>     '2.0.5',
> >>>     '2.0.6',
> >>>     '2.0.7',
> >>>     '2.0.8',
> >>>     '2.0.9' ],
> >>>  maintainers: 'maccman <macc...@gmail.com>',
> >>> On Mon, Oct 31, 2011 at 8:59 AM, Bill Walton <bwalton...@gmail.com> wrote:
> >>> > npm reports 2.0.9 (entire response pasted in below.  I'll do a gem
> >>> > install and change the Gemfile later today (probably this evening) and
> >>> > report back.
>
> >>> > SXSW isn't too far off.  If your flight plan takes you through DFW,
> >>> > let me know.  Depending on schedules, maybe I can pick you up drive
> >>> > you down.  The most direct route down the Interstate highway doesn't
> >>> > have much to recommend it in terms of scenery, but a slightly longer
> >>> > route gets you there through the Texas Hill Country.
>
> >>> > On Mon, Oct 31, 2011 at 8:42 AM, Alex MacCaw <macc...@gmail.com> wrote:
> >>> >> Yes, few things:
> >>> >> 1. Pulling it in from GithHub like that won't work
> >>> >> 2. That's the client, not the server (my bad, I asked the wrong thing)
> >>> >> What version is the server? Run:
> >>> >> npm info juggernaut
> >>> >> Thanks for the invite! Usually at SXSW, maybe see you there next year.
> >>> >> On Mon, Oct 31, 2011 at 1:37 PM, Bill Walton <bwalton...@gmail.com>
> >>> >> wrote:
>
> >>> >>> Hi Alex,
>
> >>> >>> The Gemfile is pulling it from github.  The "gem list" command doesn't
> >>> >>> show it installed but "bundle show" tells me it's using 2.0.1.  I was
> >>> >>> a little surprised with the "gem list" result.  Have only been using
> >>> >>> RVM for a couple of months and jugggernaut is the only gem being
> >>> >>> pulled into the mix in this way (gem 'juggernaut', :git =>
> >>> >>> 'git://github.com/maccman/juggernaut.git').  Do I need to do a "gem
> >>> >>> install" for it?
>
> >>> >>> Thanks,
> >>> >>> Bill
>
> >>> >>> PS.  I saw on your blog that you're headed to NYC.  If you decide
> >>> >>> you'd like to see some of Texas, shoot me a note.  I'd be very happy
> >>> >>> to get you 'pointed.'
>
> >>> >>> On Mon, Oct 31, 2011 at 4:16 AM, Alex MacCaw <macc...@gmail.com>
> >>> >>> wrote:
> >>> >>> > Bill, sorry the slow reply. Yes, looks all normal - npm has this
> >>> >>> > crazy
> >>> >>> > thing
> >>> >>> > where it doesn't share libraries. Did you find out what version of
> >>> >>> > Juggernaut you were using?
> >>> >>> > gem list juggernaut
>
> >>> >>> > On Mon, Oct 31, 2011 at 5:04 AM, Bill Walton <bwalton...@gmail.com>
> >>> >>> > wrote:
>
> >>> >>> >> Alex,
>
> >>> >>> >> Does this look normal?  Or like part of the problem?  I was pretty
> >>> >>> >> sure I got the installation right, but this gives me pause.
>
> >>> >>> >> Thanks,
> >>> >>> >> Bill
>
> >>> >>> >> On Sat, Oct 29, 2011 at 6:25 PM, Bill Walton <bwalton...@gmail.com>
> >>> >>> >> wrote:
> >>> >>> >> > So...  I gotta believe I've got a screwed up configuration.
>
> >>> >>> >> > wildbill@wildbill-hp-laptop:/$ sudo find -name socket.io
> >>> >>> >> > ./usr/local/lib/node_modules/juggernaut/node_modules/socket.io
>
> >>> >>> >> > ./usr/local/lib/node_modules/juggernaut/node_modules/socket.io/lib/socket.io
> >>> >>> >> > ./home/wildbill/.npm/socket.io
> >>> >>> >> > ./home/wildbill/.npm/socket.io/0.6.18/package/lib/socket.io
>
> >>> >>> >> > ./home/wildbill/.rvm/gems/ruby-1.9.2-p290@chat/bundler/gems/juggernaut-6085a3497efb/vendor/socket.io
> >>> >>> >> > ./home/wildbill/node_modules/socket.io
>
> >>> >>> >> > Which of these is _supposed_ to be there?  And, by extension,
> >>> >>> >> > which
> >>> >>> >> > should I update?
>
> >>> >>> >> > Thanks,
> >>> >>> >> > Bill
> >>> >>> >> > On Sat, Oct 29, 2011 at 9:15 AM, Bill Walton
> >>> >>> >> > <bwalton...@gmail.com>
> >>> >>> >> > wrote:
> >>> >>> >> >> I didn't realize I was behind.  I'll grab latest and report back
> >>> >>> >> >> soon.
>
> >>> >>> >> >> Thanks,
> >>> >>> >> >> Bill
>
> >>> >>> >> >> On Sat, Oct 29, 2011 at 9:11 AM, Alex MacCaw <macc...@gmail.com>
> >>> >>> >> >> wrote:
> >>> >>> >> >>> Cool, no worries. That's an ancient socket.io - have you tried
> >>> >>> >> >>> using
> >>> >>> >> >>> the
> >>> >>> >> >>> latest Juggernaut first?
> >>> >>> >> >>> Alex
>
> >>> >>> >> >>> On Sat, Oct 29, 2011 at 3:09 PM, Bill Walton
> >>> >>> >> >>> <bwalton...@gmail.com>
> >>> >>> >> >>>> <macc...@gmail.com>
> >>> >>> >> >>>> wrote:
> >>> >>> >> >>>> > Hmm, that's a bit weird. What browsers are you using? What
> >>> >>> >> >>>> > version
> >>> >>> >> >>>> > of
> >>> >>> >> >>>> > Juggernaut and Socket.io are you using?
>
> >>> >>> >> >>>> > On Sat, Oct 29, 2011 at 3:06 AM, bill walton
> >>> >>> >> >>>> > <bwalton...@gmail.com>
> >>> >>> >> >>>> > wrote:
>
> >>> >>> >> >>>> >> Bump, please!
>
> >>> >>> >> >>>> >> I would really like to understand what's causing the
> >>> >>> >> >>>> >> connect-
> >>> >>> >> >>>> >> >disconnect->reconnect->disconnect->... behavior and what I
> >>> >>> >> >>>> >> > need
> >>> >>> >> >>>> >> > to do
> >>> >>> >> >>>> >> to cause the client to stay connected.  Please let me know
> >>> >>> >> >>>> >> what
> >>> >>> >> >>>> >> additional information is needed if it is.
>
> >>> >>> >> >>>> >> Thanks!
> >>> >>> >> >>>> >> Bill
>
> >>> >>> >> >>>> >> On Oct 25, 10:48 pm, Bill Walton <bwalton...@gmail.com>
> >>> >>> >> >>>> >> wrote:
> >>> >>> >> >>>> >> > Hi,
>
> >>> >>> >> >>>> >> > I'm working on a Rails 3.1 chat-type app and I'm seeing a
> >>> >>> >> >>>> >> > couple
> >>> >>> >> >>>> >> > of
> >>> >>> >> >>>> >> > things I need some advice on.
>
> >>> >>> >> >>>> >> > First, it taking what seems to me to be a long (5+
> >>> >>> >> >>>> >> > seconds)
>
> ...
>
> read more »

Bill Walton

unread,
Nov 6, 2011, 11:52:36 AM11/6/11
to Juggernaut 2

Here's the output from the same commands on the workstation. I note
that node is in fact responsive, but juggernaut and npm are not. I
wonder if all the extra 'stuff' in PATH isn't the problem, but I
haven't been able to nail down exactly where it's being added. Any
pointers would be tremendously appreciated!

wildbill@wildbill-desktop2:~$ juggernaut -help
juggernaut: command not found
wildbill@wildbill-desktop2:~$ node -v
v0.4.11
wildbill@wildbill-desktop2:~$ npm ls
No command 'npm' found, did you mean:
Command 'dpm' from package 'dpm-postgres' (universe)
Command 'dpm' from package 'dpm-mysql' (universe)
Command 'apm' from package 'apmd' (main)
Command 'rpm' from package 'rpm' (main)
Command 'gpm' from package 'gpm' (universe)
Command 'pm' from package 'powerman' (universe)
Command 'nm' from package 'binutils' (main)
Command 'nm' from package 'binutils-multiarch' (universe)
Command 'fpm' from package 'fpm2' (universe)
Command 'npg' from package 'netdisco-backend' (universe)
Command 'epm' from package 'epm' (universe)
npm: command not found
wildbill@wildbill-desktop2:~$ echo $PATH
/home/wildbill/.rvm/bin:/home/wildbill/.rvm/gems/ruby-1.9.2-head/bin:/home/wildbill/.rvm/gems/ruby-1.9.2-head@global/bin:/home/wildbill/.rvm/rubies/ruby-1.9.2-head/bin:/home/wildbill/bin:/home/wildbill/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

--------------- I really wish I'd compared PATH values prior to making
the change -----------

PATH from laptop


/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/wildbill/.rvm/bin

PATH from workstation (with extra 'stuff' removed)

Alex MacCaw

unread,
Nov 6, 2011, 12:11:55 PM11/6/11
to juggernaut...@googlegroups.com
reinstall everything (node/npm) I'd say.

--
You received this message because you are subscribed to the Google Groups "Juggernaut 2" group.
To post to this group, send email to juggernaut...@googlegroups.com.
To unsubscribe from this group, send email to juggernaut-for-r...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/juggernaut-for-rails?hl=en.

Reply all
Reply to author
Forward
0 new messages