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

Varnish IP's staleness should not be checked in request handler #5

Open
GabrSaac opened this issue Sep 8, 2016 · 0 comments
Open

Comments

@GabrSaac
Copy link

GabrSaac commented Sep 8, 2016

When the current time is after "resetAfter" hundreds of requests could call "getPrivateIPs" because "resetAfter" is set to a new value only when the "getPrivateIPs" request is fulfilled. (resetAfter can also incur in race condintions - see issue #2)

`

Requests handler (concurrent) :

privateIPs := taggedInstances
   // Check instance cache
   if time.Now().After(resetAfter) {
    privateIPs = getPrivateIPs(ec2region)
    resetAfter = time.Now().Add(time.Duration(*cache*1000) * time.Millisecond)
    taggedInstances = privateIPs
   }
@GabrSaac GabrSaac changed the title Varnish IP's staleness should be checked in request handler Varnish IP's staleness should not be checked in request handler Sep 8, 2016
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

1 participant