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

Be resilient upon startup #730

Merged

Conversation

danielmitterdorfer
Copy link
Member

With this commit we make Rally more resilient when it is not able to
determine some information upon startup of the cluster.

With this commit we make Rally more resilient when it is not able to
determine some information upon startup of the cluster.
@danielmitterdorfer danielmitterdorfer added enhancement Improves the status quo :Benchmark Candidate Management Anything affecting how Rally sets up Elasticsearch labels Jul 16, 2019
@danielmitterdorfer danielmitterdorfer added this to the 1.3.0 milestone Jul 16, 2019
Copy link
Contributor

@dliappis dliappis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Left a question and styling comments.

# noinspection PyBroadException
try:
distribution_version = es.info()["version"]["number"]
except BaseException:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need such a broad exception here? I thought (ReadTimeoutError, ConnectionTimeout, AuthorizationException, ConnectionError) is sufficient?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't but I wanted to avoid importing the elasticsearch module just for that.


def wrap(it):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PEP8: 2 blank lines here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 3cfa545. Not sure why my IDE didn't show it earlier...

def wrap(it):
return it if callable(it) else ResponseSupplier(it)

class ResponseSupplier:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PEP8: 2 blank lines here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 3cfa545.

def __call__(self, *args, **kwargs):
raise elasticsearch.TransportError

raiseTransportError = TransportErrorSupplier()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PEP8: 2 blank lines here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 3cfa545.

def __call__(self, *args, **kwargs):
raise elasticsearch.TransportError

raiseTransportError = TransportErrorSupplier()

class TransportClient:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PEP8: 2 blank lines here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 3cfa545.

@danielmitterdorfer
Copy link
Member Author

@dliappis thanks for the initial pass. I've addressed your comments. Can you please have another look?

Copy link
Contributor

@dliappis dliappis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@danielmitterdorfer danielmitterdorfer merged commit b0c7b93 into elastic:master Jul 17, 2019
@danielmitterdorfer danielmitterdorfer deleted the resilient-startup branch July 17, 2019 06:48
novosibman pushed a commit to novosibman/rally that referenced this pull request Aug 12, 2019
With this commit we make Rally more resilient when it is not able to
determine some information upon startup of the cluster.

Relates elastic#730
novosibman pushed a commit to novosibman/rally that referenced this pull request Aug 12, 2019
With this commit we make Rally more resilient when it is not able to
determine some information upon startup of the cluster.

Relates elastic#730
novosibman pushed a commit to novosibman/rally that referenced this pull request Aug 12, 2019
With this commit we make Rally more resilient when it is not able to
determine some information upon startup of the cluster.

Relates elastic#730
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Benchmark Candidate Management Anything affecting how Rally sets up Elasticsearch enhancement Improves the status quo
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants