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

Take buildTableCreationResponse out of safelyExecutes #3161

Merged
merged 1 commit into from
Dec 8, 2022

Conversation

devinrsmith
Copy link
Member

No description provided.

@devinrsmith devinrsmith added this to the Dec 2022 milestone Dec 7, 2022
@devinrsmith devinrsmith self-assigned this Dec 7, 2022
Comment on lines -408 to -409
responseObserver.onNext(ExportUtil.buildTableCreationResponse(request, (Table) obj));
responseObserver.onCompleted();
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm assuming it was on oversight this wasn't in a safelyExecute?

Copy link
Member

Choose a reason for hiding this comment

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

It doesn't hurt - the risk is that some work after the call might fail to be performed, but since this is a nonExport() submit, nothing need to be returned and stored for future ticket references.

So we're just mitigating some log messages.

I don't love overly defensive calls like this - but I also really don't love the layers we've had to stack on gRPC to make it usable at all, so I'm good with it.

Comment on lines -408 to -409
responseObserver.onNext(ExportUtil.buildTableCreationResponse(request, (Table) obj));
responseObserver.onCompleted();
Copy link
Member

Choose a reason for hiding this comment

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

It doesn't hurt - the risk is that some work after the call might fail to be performed, but since this is a nonExport() submit, nothing need to be returned and stored for future ticket references.

So we're just mitigating some log messages.

I don't love overly defensive calls like this - but I also really don't love the layers we've had to stack on gRPC to make it usable at all, so I'm good with it.

.setSuccess(false)
.setErrorInfo(errorInfo)
.build();
safelyExecuteLocked(responseObserver, () -> responseObserver.onNext(response));
Copy link
Member

Choose a reason for hiding this comment

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

We've got so many of these... I almost want to just have a wrapper/subtype of StreamObserver that does these for us, like onCompleted(Response) to do both onNext and onCompleted safely+locked, and auto-wrap both onNext and onCompleted with the lock and safe wrapper.

@devinrsmith devinrsmith merged commit a9bf6e5 into deephaven:main Dec 8, 2022
@devinrsmith devinrsmith deleted the safely-execute branch December 8, 2022 19:48
@github-actions github-actions bot locked and limited conversation to collaborators Dec 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants