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

[Backport stable/1.2] Correctly truncate a job activation batch if it will not fit in the dispatcher #8831

Merged
6 commits merged into from
Feb 23, 2022

Conversation

github-actions[bot]
Copy link
Contributor

Description

Backport of #8799 to stable/1.2.

relates to #8797 #5525

Use `int` type instead of `long` for events/records. Under the hood, we
always use `int` and not `long`, simply widening the values to return
longs. It seemed unnecessary in the end, especially since we always deal
with the `ByteBuffer` type in the end, which only allows buffers with up
to `Integer.MAX_VALUE` length.

(cherry picked from commit a53fb85)
Replaces creating the state manually in the `VariableBehaviorTest` and
reuses the extension instead.

(cherry picked from commit 829b592)
Adds size probing capabilities to the `TypedEventWriter`, namely one
`#canWriteEventOfLength(int)` which checks if an additional event of the
given length could be written. This simply delgates to the batch writer
under the hood the normal case, with some sane overrides for other
implementations.

Additionally delegates to the writer to report/determine the
`maxEventLength` instead of getting it from the `ProcessingContext`.

The reasoning for both is that these are writer specific properties:
it's the writer's responsibility to know what it can write, and whether
it can write it or not.

(cherry picked from commit 3d8af7b)
Extracts collecting activatable jobs for a job batch activation request
into a specific class. This allows more narrowed, simpler testing of the
behavior. Additionally, the behavior makes use of the new
`TypedEventWriter#canWriteEventOfLength(int)` API.

(cherry picked from commit 0c1985f)
Renames record type `LargeJob` to `TooLargeJob` to better reflect the
fact that it is excessively large.

(cherry picked from commit fe996c2)
Copy link
Member

@npepinpe npepinpe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bors merge

@ghost ghost merged commit 6e4ae2a into stable/1.2 Feb 23, 2022
@ghost ghost deleted the backport-8799-to-stable/1.2 branch February 23, 2022 19:20
This pull request was closed.
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.

None yet

1 participant