Giter VIP home page Giter VIP logo

bimodal-multicast's People

Contributors

dependabot[bot] avatar rstefan1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

doytsujin

bimodal-multicast's Issues

Connection refused at solicitation post

In tests:

HTTP Server
/home/runner/workspace/src/github.com/rstefan1/bimodal-multicast/pkg/internal/server/server_test.go:57
  at solicitation request
  /home/runner/workspace/src/github.com/rstefan1/bimodal-multicast/pkg/internal/server/server_test.go:186
    responds with synchronization message [It]
    /home/runner/workspace/src/github.com/rstefan1/bimodal-multicast/pkg/internal/server/server_test.go:217

    Expected success, but got an error:
        <*url.Error | 0xc0000b5e90>: {
            Op: "Post",
            URL: "http://localhost:35619/solicitation",
            Err: {
                Op: "dial",
                Net: "tcp",
                Source: nil,
                Addr: {
                    IP: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 127, 0, 0, 1],
                    Port: 35619,
                    Zone: "",
                },
                Err: {Syscall: "connect", Err: 0x6f},
            },
        }
        Post http://localhost:35619/solicitation: dial tcp 127.0.0.1:35619: connect: connection refused

    /home/runner/workspace/src/github.com/rstefan1/bimodal-multicast/pkg/internal/server/server_test.go:244

    Full Stack Trace
    	/home/runner/workspace/src/github.com/rstefan1/bimodal-multicast/vendor/github.com/onsi/gomega/internal/assertion/assertion.go:75 +0x305
    github.com/rstefan1/bimodal-multicast/vendor/github.com/onsi/gomega/internal/assertion.(*Assertion).To(0xc0000c5700, 0xae0240, 0xef3228, 0x0, 0x0, 0x0, 0x0)
    	/home/runner/workspace/src/github.com/rstefan1/bimodal-multicast/vendor/github.com/onsi/gomega/internal/assertion/assertion.go:38 +0x11f
    github.com/rstefan1/bimodal-multicast/pkg/internal/server.glob..func1.4.3()
    	/home/runner/workspace/src/github.com/rstefan1/bimodal-multicast/pkg/internal/server/server_test.go:244 +0x921
    github.com/rstefan1/bimodal-multicast/vendor/github.com/onsi/ginkgo/internal/leafnodes.(*runner).runSync(0xc0000c3020, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
    	/home/runner/workspace/src/github.com/rstefan1/bimodal-multicast/pkg/internal/server/server_suite_test.go:28 +0xf7
    testing.tRunner(0xc00018a200, 0xa68ac8)
    	/usr/local/golang/1.11/go/src/testing/testing.go:827 +0x163
    created by testing.(*T).Run
    	/usr/local/golang/1.11/go/src/testing/testing.go:878 +0x651
    ```

Gossip Round

  • implement GossipRound goroutine
  • Protocol/GossipRound must be an object with the method Start and peers and buffers private fields
  • allow the client to inject some configs (HTTP server address & port, an initial state of buffers, size of buffers, etc)
  • add a channel to gracefully shut down HTTP Server & test it
  • add a channel to gracefully shut down Gossip Round Goroutine & test it
  • tests

Implement publisher-subcriber pattern

Nodes should subscribe to certain events. Each message has an event type. When a node receives a message of the type of event it subscribes to, it will call the associated callback.

Connection refused when restart the protocol

Describe the bug
When I restart the protocol, I get the following error:

Gossiper from localhost:34241 can not marshal the gossip message: Post http://localhost:38133/gossip: dial tcp [::1]:38133: connect: connection refused

The protocol from [::1]:38133 was restarted.

How To Reproduce

p.Stop()
p.Start()

Multiple calls for the same message

Two request messages may appear at the same time. The callbacks will be called twice, once for each message, but the message will be added once in the buffer.

HTTP Server

  • handler for Gossip Message
  • handler for Solicitation Message
  • handler for Synchronization Message
  • put in gossip message the round number
  • unit tests for handlers
  • catch the errors
  • cleanup code (set random ports for servers, remove sleeps from tests, use Eventually in tests, etc.)

Add an exported type for Protocol

Fields (unexported):

  • stop channel
  • gossip server
  • http server

Functions (exported):

  • New(cfg ProtocolConfig)
  • Start(stop chan)
  • Stop()
  • AddMessage(msg string)
  • GetMessages()

Buffers

  • implement buffers
  • add unit tests for functions from internal package

Check if round numbers are matching

We must inject the gossip round in gossip message.
Also, we must inject the gossip round in synchronization message.

When a node receives a synchronization message, it must check if the gossip round from the gossip message and the gossip round from the synchronization messageare matching.

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.