Skip to content

Commit 8286f45

Browse files
goznaukbednar
andauthored
fix: prevent creating unnecessary threads repeatedly (influxdata#562)
* fix: prevent creating unnecessary threads repeatedly Use ThreadPoolScheduler for WriteApi batch subject instead of TimeoutScheduler. Fixes influxdata#561 * docs: Update CHANGELOG.md * docs: update CHANGELOG.md --------- Co-authored-by: Jakub Bednář <jakub.bednar@gmail.com>
1 parent eb5afd1 commit 8286f45

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
## 1.40.0 [unreleased]
22

3+
### Bug Fixes
4+
1. [#562](https://github.com/influxdata/influxdb-client-python/pull/562): Use `ThreadPoolScheduler` for `WriteApi`'s batch subject instead of `TimeoutScheduler` to prevent creating unnecessary threads repeatedly
5+
36
## 1.39.0 [2023-12-05]
47

58
### Features

influxdb_client/client/write_api.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,8 @@ def __init__(self,
258258
self._disposable = self._subject.pipe(
259259
# Split incoming data to windows by batch_size or flush_interval
260260
ops.window_with_time_or_count(count=write_options.batch_size,
261-
timespan=timedelta(milliseconds=write_options.flush_interval)),
261+
timespan=timedelta(milliseconds=write_options.flush_interval),
262+
scheduler=ThreadPoolScheduler(1)),
262263
# Map window into groups defined by 'organization', 'bucket' and 'precision'
263264
ops.flat_map(lambda window: window.pipe(
264265
# Group window by 'organization', 'bucket' and 'precision'

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy