Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infinite loop #30

Open
eportico opened this issue Mar 17, 2015 · 23 comments
Open

Infinite loop #30

eportico opened this issue Mar 17, 2015 · 23 comments

Comments

@eportico
Copy link

I use multicore cluster mode. When reload page ( i use ironrouter) the web enter in a loop reload infinite.
When disable cluster workers, the web work fine

@arunoda
Copy link
Member

arunoda commented Mar 18, 2015

Is this happens locally or in production. I'd like to see sample repo where I can work on it.

@movaps
Copy link

movaps commented Mar 18, 2015

I'm also seeing this issue or at least a variant of it. In my case it seems unrelated to manual page reloading, but whenever the page is updated through a hot code push, the "infinite reload loop" starts and nothing short of restarting the server will break it. New clients connecting to the server will also experience it.

I've managed to narrow it down somewhat, and it seems like it only happens if the client folder is huge. The following should be enough to reproduce it:

meteor create --example leaderboard cluster_looptest
cd cluster_looptest
meteor add meteorhacks:cluster

mkdir client
mv leaderboard.html client/
mv leaderboard.css client/

cd client
mkdir some_subfolder && cd some_subfolder

curl -o d3.js http://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js
cp d3.js d4.js && cp d3.js d5.js && cp d3.js d6.js && cp d3.js d7.js

cd ..
mkdir some_other_subfolder
cp -r some_subfolder/ some_other_subfolder/
cd ..

CLUSTER_DISCOVERY_URL=mongodb://localhost:27017/cluster_looptest \
CLUSTER_ENDPOINT_URL=http://localhost:3000/ \
CLUSTER_WORKERS_COUNT=auto \
CLUSTER_SERVICE=web \
meteor

# Now wait for the server to start, then open the app and change
# some whitespace or whatever in leaderboard.html and save it.

Edit: for what it's worth, I'm using the latest release versions of meteor (1.0.4.1) and meteorhacks:cluster (1.6.1)

@eportico
Copy link
Author

Thanks @NovaPS
Yes, the issue is in local mode ( i not test in production)
Yes, the fail is procuced by a hot push from server.

@movaps
Copy link

movaps commented Mar 20, 2015

@arunoda : were you able to reproduce this, or do you need further information?

@arunoda
Copy link
Member

arunoda commented Mar 20, 2015

Hmm. I tried now.
But I couldn't reproduce it :(

May be this is due to Meteor's local hot push stuff and how it deals with the proxy meteor created.
I hope this should not affect in the production mode.

@movaps
Copy link

movaps commented Mar 22, 2015

I haven't tested it in production mode, but the snippet above causes the error every single time on my test rigs. The amount of stuff in the client folder is directly coorelated to the error though (Some rigs require more, some less), so if you're having trouble reproducing it just put more stuff in there, eventually you'll run into it.

@aykutyaman
Copy link

it happens to me also, but in production. A server restart doesn't solve the issue, so I'm gonna remove cluster.

@darkship
Copy link

darkship commented Jun 9, 2015

Since I added the multi balancer, I noticed some loops too.

After updating my app, the app reloads in infinite loop (but not every time). On Firefox I had to reopen the window and on Chrome I had to clean the cache.

Sometimes after a page refresh or a route change, it reloads 3-4 times before it stops or it get stuck like if the publish doesn't sent any ready

It's maybe not related but I had to remove meteorhacks:zones to avoid getting a blank page after a "too much recursion".

@forgitit
Copy link

I have the same issue using only the Multi-Core feature of cluster (cluster workers).

It goes into a refresh loop on hot code push, it will eventually stop, sometimes giving 'unspecified error'. Restarting the server fixes it, but only until the next code change.

Here's an example: http://i.imgur.com/GTHwcGh.gif

Meteor 1.1.0.2
meteorhacks:cluster 1.6.7

@comigor
Copy link

comigor commented Aug 2, 2015

It's not a "infinite loop" to me, but like @darkship sometimes the page refreshes itself 3 or 4 times.

screen shot 2015-08-02 at 3 36 20 am

@maxpain
Copy link

maxpain commented Aug 18, 2015

@Igor1201 +1 some problem =(

@klawil
Copy link

klawil commented Aug 18, 2015

We're experiencing the same problem in production. It seems to happen any time a file is edited (the 2 instances we've had specifically are adding a file that is in /public and pulling an update from our repo that affected some files in client)

Is there any information I can provide that would help you solve this problem?

@klawil
Copy link

klawil commented Aug 19, 2015

Update that might be relevant: We just had the issue again after pulling code last night, but it didn't happen on my phone, only my laptop

@tmikoss
Copy link

tmikoss commented Sep 11, 2015

Seeing the same thing, but I managed to work around it by setting ROOT_URL to be the same as the actual IP of the instance.

We have two servers, with two workers on each. Domain name points to both IP addresses. Cluster configured via env variables:

CLUSTER_DISCOVERY_URL='mongodb://connectionurl'
CLUSTER_SERVICE='web'
CLUSTER_WORKERS_COUNT='auto'
CLUSTER_ENDPOINT_URL='http://ip.of.this.server'
ROOT_URL='http://ip.of.this.server'

When I set ROOT_URL to the domain we use for the app and restart, it goes in a refresh loop. Reset ROOT_URL to IP, all is fine.

Edit: upon further investigation setting ROOT_URL only prevents infinite loops, but the page will still re-load couple times, on each refresh.

@nicklammertyn
Copy link

Same issue here, reloading a few times before settling (between 3-7 reloads). Feels like there's a redirect going on until it finds the correct endpoint or something?

@eeiswerth
Copy link

I'm seeing this as well, but ONLY after I enable Cloudflare. I have 2 instances where one is acting as the load balancer. I enabled Cloudflare's services on the A record for the host that's acting as a load balancer.

Cloudflare works fine when I only have a single instance, but as soon as I install cluster and set it up, I see the infinite loop issue.

Anybody figure this out?

Update: It has stopped looping for me. My assumption is that the "slave" host was trying to communicate with the "master" host, where the master host was behind Cloudflare. My guess is that the cluster communication was trying to proxy through Cloudflare, which either wasn't working or just caused a loop (i.e., CF -> master -> slave -> CF -> master -> slave etc...). This is all a total guess, I didn't try and debug the actual issue.

Anyway, here's what worked for me. I added CLUSTER_ENDPOINT_URL for each server. That is all. Somehow that fixed the issue.

@tjmonsi
Copy link

tjmonsi commented Nov 1, 2015

It's also happening to me.

My setup is running on 2 DO instances that uses Meteor Cluster, then there are two Cloudflare instances (2 domain names) pointing to both, The thing is, in the root url, i only specified one of the two domains.

When I removed meteorhacks:zones, then it solved the problem...

@guns2410
Copy link

guns2410 commented Nov 5, 2015

I was having the same issue, however when removed the environment variable CLUSTER_WORKERS_COUNT=auto, the page reload loop stopped. Hope that helps!

@cihantas
Copy link

cihantas commented Feb 5, 2016

I have the same issue.
The only environment variable I've set is CLUSTER_WORKERS_COUNT=auto.

@guns2410
Copy link

guns2410 commented Feb 7, 2016

@cihantas, if you unset $CLUSTER_WORKERS_COUNT in terminal It should solve

@cihantas
Copy link

cihantas commented Feb 7, 2016

@guns2410, I already read your comment above mine, but multi-core support was the reason why I wanted to use this package in the beginning. :) Thank you anyway.

@guns2410
Copy link

guns2410 commented Feb 9, 2016

@cihantas, all I can suggest is specify the exact number of processes you want to fork. Eg: CLUSTER_WORKERS_COUNT=2. Good Luck.

@cihantas
Copy link

cihantas commented Feb 9, 2016

@guns2410, it works! 💯 Thanks, a lot.
I guess there must be some problem when cluster tries to automatically detect the number of cores.

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

No branches or pull requests