Skip to content

Riot missing features #128

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

Merged
merged 4 commits into from
May 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ tests/cloud/aws/results
tests/cloud/aws/to_upload/rendered
tests/results
c-deps/libs
c-deps/bzip2
c-deps/lz4
c-deps/zlib
c-deps/zstd

# Documents
*.pdf
Expand Down
11 changes: 4 additions & 7 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func NewHTTPClient(options ...HTTPClientOptionF) (*HTTPClient, error) {

if client.healthCheckEnabled {
// perform an initial healthcheck
client.healthCheck(client.healthCheckTimeout)
client.clusterHealthCheck(client.healthCheckTimeout)
}

// Ensure that we have at least one endpoint, the primary, available
Expand Down Expand Up @@ -251,7 +251,7 @@ func (c *HTTPClient) callPrimary(method, path string, data []byte) ([]byte, erro

if !retried && endpoint.IsDead() {
if c.healthCheckEnabled {
c.healthCheck(c.healthCheckTimeout)
c.clusterHealthCheck(c.healthCheckTimeout)
}
retried = true
continue
Expand Down Expand Up @@ -335,7 +335,7 @@ func (c *HTTPClient) doReq(method string, endpoint *endpoint, path string, data
// healthCheck does a health check on all nodes in the cluster.
// Depending on the node state, it marks connections as dead, alive etc.
// The timeout specifies how long to wait for a response from QED.
func (c *HTTPClient) healthCheck(timeout time.Duration) {
func (c *HTTPClient) clusterHealthCheck(timeout time.Duration) {

var wg sync.WaitGroup
for _, e := range c.topology.Endpoints() {
Expand Down Expand Up @@ -378,7 +378,6 @@ func (c *HTTPClient) healthCheck(timeout time.Duration) {
}

wg.Wait()

}

// discover uses the shards info API to return the list of nodes in the cluster.
Expand All @@ -387,7 +386,6 @@ func (c *HTTPClient) healthCheck(timeout time.Duration) {
func (c *HTTPClient) discover() error {

for {

e, err := c.topology.NextReadEndpoint(Any)
if err != nil {
return err
Expand Down Expand Up @@ -433,7 +431,7 @@ func (c *HTTPClient) startHealthChecker() {
case <-c.healthCheckStopCh:
return
case <-ticker.C:
c.healthCheck(timeout)
c.clusterHealthCheck(timeout)
}
}
}
Expand Down Expand Up @@ -463,7 +461,6 @@ func (c *HTTPClient) Add(event string) (*protocol.Snapshot, error) {
}

return &snapshot, nil

}

// AddBulk will do a request to the server with a post data to store a bulk of new events.
Expand Down
2 changes: 1 addition & 1 deletion client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ func TestHealthCheck(t *testing.T) {
require.False(t, client.topology.HasActiveEndpoint())

// try to revive them
client.healthCheck(5 * time.Second)
client.clusterHealthCheck(5 * time.Second)
time.Sleep(1 * time.Second)
require.True(t, client.topology.HasActiveEndpoint())
}
Expand Down
3 changes: 2 additions & 1 deletion deploy/provision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ then
fi

echo "Pulling terraform remote state to: $TF_STATE"
cd aws
terraform state pull > $TF_STATE
cd provision
cd ../provision

if [ -z "$@" ];
then
Expand Down
Loading