Skip to content

Commit b70572b

Browse files
peter-quixPeter Nagy
andauthored
Implement better handling for all broker down error (#264)
- Avoid logging all broker down exception when it does not affect publishing - Improve CONTRIBUTING guide - bump version to 2.1.3.alpha --------- Co-authored-by: Peter Nagy <[email protected]>
1 parent 27300b1 commit b70572b

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

CONTRIBUTING.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,18 @@ In general, we follow the ["fork-and-pull" Git workflow](https://github.com/susa
4141

4242
## Coding standards
4343

44-
To keep the code as consistent as possible, please familiarize yourself with the existing style of the project. If you're contributing to the Python code base, follow the [PEP 8 - Style Guide for Python Code](https://peps.python.org/pep-0008/). If contributing to the C# code base, follow the [Microsoft&reg; C# Coding Conventions](https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/coding-style/coding-conventions).
44+
To keep the code as consistent as possible, please familiarize yourself with the existing style of the project. If you're contributing to the Python code base, follow the [PEP 8 - Style Guide for Python Code](https://peps.python.org/pep-0008/).
4545

46-
> Consistency within a project is more important. Consistency within one module or function is the most important.
46+
> Consistency within a project is important. Consistency within one module or function is the most important.
4747
48-
Note that the biggest deviation from the Microsoft&reg; standards is that this project does not use `_` to indicate private members. Instead, you should use the format `this.abc`.
48+
## Setting up the project locally
49+
50+
This guide will assume you're using Visual Studio Code, but most of the guide is applicable if you're using other IDEs also.
51+
52+
1. Navigate to root of the project
53+
2. Execute `python3 -m pip install -r requirements.txt -r requirements-dev.txt -r tests/requirements.txt`
54+
3. Ensure you don't have `quixstreams` installed using `python3 -m pip uninstall quixstreams` to avoid using that when testing
55+
4. By executing `python3 -m pip install --editable .` you will be able to use the source code as a module for local testing without having to install new versions
56+
5. Add commit pre-hook: `pre-commit install`
57+
6. Configure Black code formatter.
58+
7. Run test from project root with `pytest`

quixstreams/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
from .state import State
44
from .context import message_context, message_key
55

6-
__version__ = "2.1.2alpha"
6+
__version__ = "2.1.3alpha"

quixstreams/kafka/producer.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,12 @@
2626

2727

2828
def _default_error_cb(error: KafkaError):
29+
error_code = error.code()
30+
if str(error_code) == str(KafkaError._ALL_BROKERS_DOWN):
31+
logger.debug(error.str())
32+
return
2933
logger.error(
30-
f'Kafka producer error: {error.str()} code="{error.code()}"',
34+
f'Kafka producer error: {error.str()} code="{error_code}"',
3135
)
3236

3337

0 commit comments

Comments
 (0)