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

Schemaregistrytimeoutoption #906

Closed
wants to merge 3 commits into from
Closed

Schemaregistrytimeoutoption #906

wants to merge 3 commits into from

Conversation

petebids
Copy link

@petebids petebids commented Jul 1, 2020

proposed fix for #905

@ghost
Copy link

ghost commented Jul 1, 2020

It looks like @petebids hasn't signed our Contributor License Agreement, yet.

The purpose of a CLA is to ensure that the guardian of a project's outputs has the necessary ownership or grants of rights over all contributions to allow them to distribute under the chosen licence.
Wikipedia

You can read and sign our full Contributor License Agreement here.

Once you've signed reply with [clabot:check] to prove it.

Appreciation of efforts,

clabot

@petebids
Copy link
Author

petebids commented Jul 1, 2020 via email

@ghost
Copy link

ghost commented Jul 1, 2020

@confluentinc It looks like @petebids just signed our Contributor License Agreement. 👍

Always at your service,

clabot

Copy link
Contributor

@edenhill edenhill left a comment

Choose a reason for hiding this comment

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

Thanks for your PR!

Needs a test and documentation (where other config properties are documented).

@@ -95,6 +95,8 @@ def __init__(self, conf):
raise ValueError("ssl.certificate.location required when"
" configuring ssl.key.location")

self.timeout = conf_copy.pop('timeout', 30.00)
Copy link
Contributor

Choose a reason for hiding this comment

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

How about "request.timeout", since timeout is a bit too generic?

| | | |
| ``request.timeout`` |float | |
| | | By default timeout is 30.00 seconds |
| | | the URL if present. |
Copy link
Contributor

Choose a reason for hiding this comment

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

"the URL if present." should probably be removed.

@@ -282,7 +282,12 @@ class SchemaRegistryClient(object):
| | | By default userinfo is extracted from |
| | | the URL if present. |
+------------------------------+------+-------------------------------------------------+

| | | Timeout for HTTP/S calls to Schema registry |
Copy link
Contributor

Choose a reason for hiding this comment

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

Timeout in seconds for ..


def test_timeout_exception_thrown_when_unreasonably_low_timeout_set(mock_schema_registry):
conf = {'url': TEST_URL,
'request.timeout' : 0.01
Copy link
Contributor

Choose a reason for hiding this comment

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

if TEST_URL is a valid URL I don't think a request timeout of 10ms is sufficienctly reliable to be exceeded.
Instead suggest creating a TCP listener that you connect to.

sr = mock_schema_registry(conf)
with pytest.raises(ConnectTimeoutError) as e :
sr.get_schema()
assert isinstance(e, ConnectTimeoutError)
Copy link
Contributor

Choose a reason for hiding this comment

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

why is this assert needed? I believe pytest.raises already check this

@petebids
Copy link
Author

petebids commented Jul 1, 2020

Thanks for the feedback, will get working on it :)

@petebids
Copy link
Author

petebids commented Jul 3, 2020

cant get the librdkafka to build & test locally, withdrawing

@petebids petebids closed this Jul 3, 2020
@edenhill
Copy link
Contributor

edenhill commented Jul 6, 2020

What errors were you seeing with librdkafka?

@petebids
Copy link
Author

petebids commented Jul 7, 2020

when in try to run the tests as per the instructions i get this error
https://gist.github.com/petebids/4deb838b0f333d8cb3865dce15b45722
trying to debug by using python interactive shell
https://gist.github.com/petebids/6b82dab5ed44018e44d537b6c513f34d

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

Successfully merging this pull request may close these issues.

None yet

2 participants