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

Update flow control settings #368

Merged
merged 1 commit into from
Mar 6, 2024
Merged

Update flow control settings #368

merged 1 commit into from
Mar 6, 2024

Conversation

pondzix
Copy link
Contributor

@pondzix pondzix commented Mar 6, 2024

BigQuery SDK has flow control built into it. It looks like this line blocks the calling thread, to backpressure the application thread that is trying to send events to BigQuery.

Blocking a thread can be problematic for cats-effect apps, because the thread model expects that compute threads are not used for blocking. Our loader does not need back-pressuring from the sdk, because we already have flow control built into the design of the loader (fs2 is pull-based, not push-based).

Therefore flow control settings (maxOutstandingRequestBytes and maxOutstandingElementCount) are increased to larger than defaults values to avoid thread blocking.

BigQuery SDK has flow control built into it. It looks like this [line](https://github.com/googleapis/java-bigquerystorage/blob/v2.46.0/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/ConnectionWorker.java#L547) blocks the calling thread, to backpressure the application thread that is trying to send events to BigQuery.

Blocking a thread can be problematic for cats-effect apps, because the thread model expects that compute threads are not used for blocking.  Our loader does not need back-pressuring from the sdk, because we already have flow control built into the design of the loader (fs2 is pull-based, not push-based).

Therefore flow control settings (`maxOutstandingRequestBytes` and `maxOutstandingElementCount`) are increased to larger than defaults values to avoid thread blocking.
@pondzix pondzix merged commit 016b844 into v2 Mar 6, 2024
2 checks passed
@istreeter
Copy link
Contributor

For visibility... I verbally approved this to @pondzix before he merged it.

@istreeter istreeter deleted the disable_flow_control branch March 19, 2024 08:48
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.

2 participants