GithubHelp home page GithubHelp logo

dns-clb-go's People

Contributors

benschw avatar sheldonh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dns-clb-go's Issues

panic when dns server is down

-- FAIL: TestGet (0.00s)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x146263]

goroutine 5 [running]:
testing.func·006()
/Users/youngking/.gvm/gos/go1.4.2/src/testing/testing.go:441 +0x181
github.com/benschw/dns-clb-go/dns.(_LookupLib).lookup(0xc20800abb0, 0xc20801e0c0, 0x1a, 0x3d59b0, 0x3, 0x3df690, 0x3, 0xc20802a600, 0x0, 0x0)
/Users/youngking/gspace/src/github.com/benschw/dns-clb-go/dns/lib.go:107 +0x3d3
github.com/benschw/dns-clb-go/dns.(_LookupLib).lookup(0xc20800abb0, 0xc20801e0c0, 0x1a, 0x3d59b0, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0)
/Users/youngking/gspace/src/github.com/benschw/dns-clb-go/dns/lib.go:104 +0x39b
github.com/benschw/dns-clb-go/dns.(_LookupLib).lookupType(0xc20800abb0, 0x4228f0, 0x19, 0x3d59b0, 0x3, 0x0, 0x0, 0x0)
/Users/youngking/gspace/src/github.com/benschw/dns-clb-go/dns/lib.go:85 +0x7c
github.com/benschw/dns-clb-go/dns.(_LookupLib).LookupSRV(0xc20800abb0, 0x4228f0, 0x19, 0x0, 0x0, 0x0, 0x0, 0x0)
/Users/youngking/gspace/src/github.com/benschw/dns-clb-go/dns/lib.go:43 +0xce
github.com/benschw/dns-clb-go/randomclb.(*RandomClb).GetAddress(0xc20800abc0, 0x4228f0, 0x19, 0x0, 0x0, 0x0, 0x0, 0x0)
/Users/youngking/gspace/src/github.com/benschw/dns-clb-go/randomclb/random.go:22 +0xbf

web discovery

I really like this approach.

So, for dumb web apps, some extra things are needed.

Lets asume:

  1. www.example.com boots off s3. done
  2. api.example.com represents your client side load balancer services

to make this work a web sockets Or http long polling layer is needed to constantly update the web clients about what servers are up, with them ordered based on priority.

What do you think ?

RandomClb panic when no SRV records found

RandomClb.GetAddress() panics when there are no SRV records found for the given name. RoundRobinClb guards against this, returning fmt.Errorf("no SRV records found"), but RandomClb gives:

panic: invalid argument to Intn

goroutine 16 [running]:
runtime.panic(0x5cf040, 0xc208000710)
        /usr/local/go/src/pkg/runtime/panic.c:279 +0xf5
math/rand.(*Rand).Intn(0xc208000160, 0x0, 0x0)
        /usr/local/go/src/pkg/math/rand/rand.go:95 +0x71
math/rand.Intn(0x0, 0x698577)
        /usr/local/go/src/pkg/math/rand/rand.go:195 +0x34
github.com/benschw/dns-clb-go/randomclb.(*RandomClb).GetAddress(0xc2080005a0, 0x698577, 0x17, 0x0, 0x0, 0x0, 0x0, 0x0)
        /home/sheldonh/go/src/github.com/benschw/dns-clb-go/randomclb/random.go:27 +0x126
main.main()
        /home/sheldonh/go/src/github.com/sheldonh/foo/foo.go:24 +0x36d

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.