-
Notifications
You must be signed in to change notification settings - Fork 915
Include C3 monitoring interceptors and update packaging validation #464
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
Conversation
* | ||
* @returns 0 on success or -1 on failure (exception raised). | ||
*/ | ||
static int common_conf_set_special(PyObject *confdict, rd_kafka_conf_t *conf, const char *name, PyObject *vo) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try to < 80 columns
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use @param vo The property value object
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Presumably this is because vo's name and type are fairly ambiguous?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
const char *v; | ||
char errstr[256]; | ||
|
||
PyObject *vs = NULL, *vs8 = NULL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all variable definitions in one consecutive block at the head of the function, that is, move this above the empty line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vs does not need NULL initialization
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ack, although is there any harm in initializing it? Here it doesn't matter but in the while loop you will throw uninitialized variable warnings because we jump to inner_error which references them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code is documentation. If something is done explicitly the reader thinks there is a reason for it. If there is no reason, we thus shouldn't do it, to avoid confusing the reader.
PyErr_Format(PyExc_TypeError, "expected configuration property %s " | ||
"as type unicode string here", name); | ||
|
||
Py_XDECREF(vs); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this does nothing, vs is always NULL here
return -1; | ||
} | ||
|
||
Py_XDECREF(vs); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Py_DECREF(), we know vs is non-NULL.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I was thinking consistency might be nice but it unnecessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code is also documenting the assumptions of availability, state, etc.
If a variable needs to be checked, then check it.
If we know a variable is always set, don't check it.
*/ | ||
if ((vo = PyDict_GetItemString(confdict, "debug"))) { | ||
if (common_conf_set_special(confdict, conf, "debug", vo)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need for braces for single line blocks.
suggest you explicitly check for return value == -1, or change set_special to return 0 on error and 1 on success.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope not needed, although arguably it does make it easier to read
/* Enable valid offsets in delivery reports */ | ||
rd_kafka_conf_set(conf, "produce.offset.report", "true", NULL, 0); | ||
/* | ||
* Default config (overridable by user) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment doesn't seem to be true anymore.
/* Resolve plugin paths */ | ||
PyObject *resolved; | ||
resolved = resolve_plugins(vo); | ||
if (!resolved) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove braces
Py_XDECREF(ks8); | ||
Py_XDECREF(ks); | ||
|
||
Py_DECREF(confdict); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
goto outer_err here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good call
@edenhill plugged some leaks, fixed some docs. Mind giving it another go |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tiny miny
|
||
/* Enable valid offsets in delivery reports */ | ||
rd_kafka_conf_set(conf, "produce.offset.report", "true", NULL, 0); | ||
if ((vo = PyDict_GetItemString(confdict, "debug"))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
micro nit: Personally I would wrap the outer block in { }, or turn it into a single if:
if ((vo = .. ) && !common_set_sp..)) \n goto outer_err
} | ||
PyDict_DelItemString(confdict, "default.topic.config"); | ||
} | ||
|
||
/* Convert config dict to config key-value pairs. */ | ||
while (PyDict_Next(confdict, &pos, &ko, &vo)) { | ||
PyObject *ks, *ks8; | ||
PyObject *ks = NULL, *ks8 = NULL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ks does not need initialization
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are no tests for the monics using the binary wheels, should be added to test-osx test-manylinux.
.appveyor.yml
Outdated
@@ -1,6 +1,6 @@ | |||
environment: | |||
global: | |||
LIBRDKAFKA_NUGET_VERSION: 0.11.6-RC3 | |||
LIBRDKAFKA_NUGET_VERSION: 0.11.6-RC4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LIBRDKAFKA_NUGET_VERSION: 0.11.6-RC4 | |
LIBRDKAFKA_NUGET_VERSION: 0.11.6-RC5 |
.travis.yml
Outdated
@@ -1,32 +1,32 @@ | |||
matrix: | |||
include: | |||
# Source package verification with Python 2.7 and librdkafka v0.11.6-RC3 | |||
# Source package verification with Python 2.7 and librdkafka v0.11.6-RC4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RC4 -> RC5 across the board
.travis.yml
Outdated
- if [[ -z $CIBW_BEFORE_BUILD ]]; then py.test -v --timeout 20 --ignore=tmp-build --import-mode append ; fi | ||
- if [[ -n $TRAVIS_TAG && -n $CIBW_BEFORE_BUILD ]]; then cibuildwheel --output-dir wheelhouse ; ls -la wheelhouse/ ; fi | ||
# Make plugins available for tests | ||
- ldd staging/libs/* || true ; otool -L staging/libs/* || true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- ldd staging/libs/* || true ; otool -L staging/libs/* || true | |
- ldd staging/libs/* || otool -L staging/libs/* || true |
tests/test_misc.py
Outdated
f = os.path.join(path, "monitoring-interceptor" + ext) | ||
if os.path.exists(f): | ||
return False | ||
print('Not found: {}'.format(f)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
print('Not found: {}'.format(f)) |
tools/RELEASE.md
Outdated
|
||
$ git commit -m "librdkafka version bump to v0.11.6" .travis.yml .appveyor.yml | ||
* `tools/install-interceptors.sh` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* `tools/install-interceptors.sh` | |
* `tools/install-interceptors.sh` - edit and change version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just above this we state the following:
"Change to the latest version of the confluent-librdkafka-plugins in:"
To be clear this in addition to this statement not a replacement correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just wanted to clarify that the file needs editing rather than being run, since referencing a shell script in backticks usually suggests the latter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure works for me just wanted to make sure
tools/test-osx.sh
Outdated
@@ -34,15 +34,15 @@ pip install confluent_kafka --no-cache-dir --no-index -f $WHEELHOUSE | |||
# https://github.com/pypa/pip/issues/5247 | |||
pip install pytest pytest-timeout --ignore-installed six | |||
|
|||
# Verify that OpenSSL and zlib are properly linked |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tthink we should do cd ..
here prior to all the remaining steps
2442325
to
0b2cce3
Compare
I cannot stress how happy I am about this. I know it is an awful practise to make +1 comments on issues, but I really want to show my appreciation to you guys @rnpridgeon and @edenhill 💖 🎉 You have officially made my day! 🥇 |
No description provided.