-
Notifications
You must be signed in to change notification settings - Fork 556
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
Shape legacy code into new interfaces good bits part 2 #9844
Shape legacy code into new interfaces good bits part 2 #9844
Conversation
Currently, the process builder is handed over to the engine, but the engine doesn't use it yet to build the result. Instead, the engine writes to the wrapped response writer directly. This circumvents the flag and in turn leads to no response being sent.
…gStateMachine The side effects were already collected by the engine, but nobody executed the side effects. Secondly, the sending of the response used to be just another side effect. Now it is a special action which is under direct control by ProcessingStateMachine.
This is because sending of responses is now part of the ProcessingStateMachine. It is a dedicated step and no longer part of the side effects
Prevent pushing response more than once in DirectProcessingResult Remove manual call to responseWriter.flush()
The tests failed for two reasons: The process instance key was not set. Some intent JobIntent.COMPLETE which should not be blacklisted at all, but was This was because the old code: zeebeState.getBlackListState().tryToBlacklist(typedCommand, errorRecord::setProcessInstanceKey); Did check the intents and did set process instance key with this strange setter. Now, we don't use the logic anymore and instead create en error event. However, the event applier is not aware of the logic and has no access to the intent of the record that caused the error.
|
||
public Engine() {} | ||
|
||
@Override | ||
public void init(final RecordProcessorContext recordProcessorContext) { | ||
streamWriter = recordProcessorContext.getStreamWriterProxy(); |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation
|
||
public Engine() {} | ||
|
||
@Override | ||
public void init(final RecordProcessorContext recordProcessorContext) { | ||
streamWriter = recordProcessorContext.getStreamWriterProxy(); | ||
responseWriter = recordProcessorContext.getTypedResponseWriter(); |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation
|
||
final var zeebeState = typedProcessorContext.getZeebeState(); | ||
writers = typedProcessorContext.getWriters(); | ||
recordProcessorContext.setWriters(writers); |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
Nothing major, it's nice to see things coming together 👍
engine/src/main/java/io/camunda/zeebe/streamprocessor/ErrorHandlingContextImpl.java
Show resolved
Hide resolved
engine/src/main/java/io/camunda/zeebe/streamprocessor/ProcessingContextImpl.java
Show resolved
Hide resolved
bors merge |
9840: `TypedStreamWriter` that writes to buffer r=pihme a=pihme ## Description - Implements `TypedStreamWriter` that writes to buffer - Implements processing result builder to use the buffered stream writer - does not add tests. I started it, but it would take too much time. Hope I can revisit it after my holidays. For now there is just a follow up issue: #9838 ## Related issues closes #9780 9844: Shape legacy code into new interfaces good bits part 2 r=pihme a=pihme ## Description - Move logic to select processor into engine - Move processing logic into engine - Use `ProcessingResult` to return response and execute side effects - Move error handling logic into engine - Fix tests ## Review Hints - most of the commits have some failing tests - this was unavoidable, because substeps in the modification were invalid/incomplete - In the end, all tests are now passing again. This was quite satisfying acutally - adding more changes and seeing the test failure count go down again - Overall I would say we are through the valley of pain. Was quite volatile recently, but I am confident we can bring some calmness back to development - This achieves that most of the engine abstraction classes are in play; and the division of labor is largely as intended. - Still lots of stuff to do on either side, though ## Related issues related to #9725 Co-authored-by: pihme <pihme@users.noreply.github.com>
Build failed (retrying...): |
Build succeeded: |
Description
ProcessingResult
to return response and execute side effectsReview Hints
Related issues
related to #9725
Definition of Done
Not all items need to be done depending on the issue and the pull request.
Code changes:
backport stable/1.3
) to the PR, in case that fails you need to create backports manually.Testing:
Documentation:
Please refer to our review guidelines.