-
Notifications
You must be signed in to change notification settings - Fork 15
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
Apply recent API changes #679
Conversation
Return type is not necessary, since return was always true, which is why it has been removed from the API.
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.
Maybe to explain why the tests are failing. We are keeping track of a map of requests Long registerNewRequest(
final Class<? extends GeneratedMessageV3> requestType,
final StreamObserver<?> responseObserver) {
final long currentRequestId = requestIdGenerator.incrementAndGet();
requestMap.put(currentRequestId, new Request(requestType, responseObserver));
return currentRequestId;
} When a response is written we remove the request from this map and send the response to the client @Override
public void tryWriteResponse(final int requestStreamId, final long requestId) {
if (rejectionType != RejectionType.NULL_VAL) {
final Status rejectionResponse =
responseMapper.createRejectionResponse(rejectionType, intent, rejectionReason);
final Request request = gatewayRequestStore.removeRequest(requestId);
sendError(request, rejectionResponse);
return;
}
try {
final Request request = gatewayRequestStore.removeRequest(requestId);
final GeneratedMessageV3 response =
responseMapper.map(request.requestType(), valueBufferView, key, intent);
sendResponse(request, response);
} catch (final Exception e) {
throw new RuntimeException(e);
}
} Since there is multiple responses for a single request we run into an NPE. We could fix it by not sending a response if we can't find the corresponding request. But I'd like to make sure this isn't a bug in Zeebe. |
@remcowesterhoud I think it is a bug in zeebe. https://github.com/camunda/zeebe/blob/main/stream-platform/src/main/java/io/camunda/zeebe/stream/impl/ProcessingStateMachine.java#L356 It is not really problematic, since the response is not sent twice if it was already sent, but yeah something which we should clean up. I guess we should use a hashset instead of a list in the ProcessingStateMachine \cc @oleschoenburg |
Thanks for @remcowesterhoud checking the failures. I'm currently on FTO so have not time to fix it today. |
Fix is prepared: camunda/camunda#11892, I guess we can merge this tomorrow. |
Thanks to @oleschoenburg the CI is green again, I have rerun the jobs @remcowesterhoud I think we can merge it now. |
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.
Perfect, thanks both!
bors merge
Build succeeded: |
Description
Return type is not necessary, since return was always true, which is why it has been removed from the API.
Related issues
Related to changes made here camunda/camunda@b4e0e05
Definition of Done
Not all items need to be done depending on the issue and the pull request.
Code changes:
Testing:
Documentation: