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

Builder shouldn't quit on connection loss #3

Closed
Fuuzetsu opened this issue Jul 3, 2014 · 6 comments
Closed

Builder shouldn't quit on connection loss #3

Fuuzetsu opened this issue Jul 3, 2014 · 6 comments

Comments

@Fuuzetsu
Copy link
Member

Fuuzetsu commented Jul 3, 2014

Currently builder terminates if it loses connection which means that we have to check every now and again and manually restart it. It'd be nice if it just waited for a connection to come back and resume its regular duties.

@cartazio
Copy link
Contributor

cartazio commented Jul 4, 2014

what retry logic should it have?

@pgj
Copy link
Contributor

pgj commented Jul 4, 2014

I think the client already implements exponential backoff when it cannot connect to the server. Perhaps the same could also work here too.

@Fuuzetsu
Copy link
Member Author

Fuuzetsu commented Jul 5, 2014

Just waiting until it can connect again and behaving as if it was started fresh (so send any lagging data or whatever) should be enough.

@AlainODea
Copy link
Contributor

@Fuuzetsu are you still experiencing this? If not I can close this issue.

If so, how does this appear in logs when it disconnects? My builders generally survive network outages. I'm running them on a repurposed PC on a home network so there's nothing special shielding them from issues. It's possible that SMF (service management framework) is restarting the service..

This code in client.hs already does indefinate connection retries with 5 second sleeps between attempts:

`onConnectionDropped`
  do verbose' v user ("Connection dropped...sleeping for 5 seconds...")
    threadDelay (5 * 1000000)
    connLoop curDir baseDir user host

SOURCE:

`onConnectionDropped`
do verbose' v user ("Connection dropped...sleeping for 5 seconds...")
threadDelay (5 * 1000000)
connLoop curDir baseDir user host

c host `onConnectionFailed`
  do verbose' v user ("Failed...sleeping for " ++ show secs ++ " seconds...")
    threadDelay (secs * 1000000)
    conn user host ((secs * 2) `min` 600)

SOURCE:

c host `onConnectionFailed`
do verbose' v user ("Failed...sleeping for " ++ show secs ++ " seconds...")
threadDelay (secs * 1000000)
conn user host ((secs * 2) `min` 600)

@Fuuzetsu
Copy link
Member Author

@AlainODea I haven't used this in years so I don't know, sorry.

@AlainODea
Copy link
Contributor

@Fuuzetsu no worries at all.

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

4 participants