Skip to content

Commit

Permalink
Add a setting for batch_join_timeout (#6314)
Browse files Browse the repository at this point in the history
Closes #6306
  • Loading branch information
davidtsuk authored Sep 17, 2024
1 parent 29438a7 commit 9b2b0ab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion snuba/clickhouse/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,9 @@ def write(self, values: Iterable[bytes]) -> None:
batch.append(value)

batch.close()
batch_join_timeout = state.get_config("http_batch_join_timeout", 10)
batch_join_timeout = state.get_config(
"http_batch_join_timeout", settings.BATCH_JOIN_TIMEOUT
)
# IMPORTANT: Please read the docstring of this method if you ever decide to remove the
# timeout argument from the join method.
batch.join(timeout=batch_join_timeout)
1 change: 1 addition & 0 deletions snuba/settings/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ class RedisClusters(TypedDict):
DISCARD_OLD_EVENTS = True
CLICKHOUSE_HTTP_CHUNK_SIZE = 8192
HTTP_WRITER_BUFFER_SIZE = 1
BATCH_JOIN_TIMEOUT = os.environ.get("BATCH_JOIN_TIMEOUT", 10)

# Retention related settings
ENFORCE_RETENTION: bool = False
Expand Down

0 comments on commit 9b2b0ab

Please sign in to comment.