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

Client should not panic if an operation doesn't return anything #169

Open
gregolsky opened this issue Aug 18, 2021 · 0 comments
Open

Client should not panic if an operation doesn't return anything #169

gregolsky opened this issue Aug 18, 2021 · 0 comments
Assignees

Comments

@gregolsky
Copy link
Member

gregolsky commented Aug 18, 2021

The client 'panics' when OperationIDResult is not returned by the server. That should not be the case. There are various commands which do not return anything (Send() returns void) or do return something else (TResult).

panicIf(true, "called on a command %T that doesn't return OperationIDResult", cmd)

Please refer to ServerOperationExecutor code in C#:
https://github.com/ravendb/ravendb/blob/49086f551a2ec7349c0922f6ec96c189f94fb7a6/src/Raven.Client/ServerWide/Operations/ServerOperationExecutor.cs

As you can see there are various method overloads - some returning void:

public void Send(IServerOperation operation)
public TResult Send<TResult>(IServerOperation<TResult> operation)
public Operation Send(IServerOperation<OperationIdResult> operation)

public async Task SendAsync(IServerOperation operation, CancellationToken token = default)
public async Task<TResult> SendAsync<TResult>(IServerOperation<TResult> operation, CancellationToken token = default)
public async Task<Operation> SendAsync(IServerOperation<OperationIdResult> operation, CancellationToken token = default)

The issue might not be in the ServerOperationExecutor alone - it may be the case with other operation executor classes as well.

Please advise.

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

No branches or pull requests

2 participants