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

global backaddr is assumed to be static #84

Closed
yogo1212 opened this issue Apr 25, 2016 · 6 comments
Closed

global backaddr is assumed to be static #84

yogo1212 opened this issue Apr 25, 2016 · 6 comments
Assignees

Comments

@yogo1212
Copy link

hi :-)

when configuring a hostname for a backend the hostname is only resolved once in init_globals.
=>
in a way, hitch acts as a DNS cache that doesn't respect TTL.

related use case: using amazon ELB as backend.

possible solution: register an event to refresh the cached value of backaddr when the DNS value expires.

@olivierHa
Copy link

Any updates about this issue ? Is this also affecting docker internal name resolution ?

@yogo1212
Copy link
Author

@olivierHa
the issue i've described only affects hitch internally.
e.g.

start hitch -> A record with TTL 20 received
one minute passes
DNS changes, server goes down
hitch loses connection
hitch retries using the expired address until something stops it.

we've replaced hitch with nginx in our application

@dmatetelki
Copy link
Contributor

I've started to work on a periodic backend IP check fix (with the guidance of @daghf ), let me update the progress here.

@dmatetelki dmatetelki self-assigned this Oct 4, 2017
@rtkbkish
Copy link

rtkbkish commented Oct 4, 2017

@dmatetelki Thanks. This will be very helpful.

dmatetelki added a commit that referenced this issue Oct 4, 2017
!!!DRAFT!!!

todo:
	handle change between create socket and connect
	testing
@gquintard
Copy link
Contributor

I'm interested by the approach here. First thing is when do we update the pool, and the second one is: how do we spread connections? Last one is what do we do in case of failure?

@dmatetelki
Copy link
Contributor

Hi @rtkbkish, @gquintard, @yogo1212 and @daghf !

The first version is ready to be tested. (thou i did create a testcase)
The patch:

  • introduces a new parameter, -R --backendrefresh=USECS which allows periodic backend address lookup. You turn it off / have static backend address with value 0. Default is 1s.
  • The main process refreshes (or not) the address, and notify the client processes.
  • The client processes do the create socket and connect now in end_handshake, not in 2 functions, for concurrency safety.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants