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

--timeout not available on search #185

Closed
jeffr1975 opened this issue Mar 24, 2021 · 6 comments · Fixed by #231
Closed

--timeout not available on search #185

jeffr1975 opened this issue Mar 24, 2021 · 6 comments · Fixed by #231
Labels
bug Something isn't working

Comments

@jeffr1975
Copy link

Running into timeout issues when running a seqcli search. It looks like the timeout argument is only an option with query.

The filter option seems to be much faster than query. Is that expected?

{Property='XXX'} filter is much faster than select * from stream where Property='xxx' limit 1000

And also select * from stream does not seem to return the same json that that filter does? Is my query just wrong?

I was very happy with search with a filter in json format until I ran into the timeout because that was producing output that could be easily ingested. I'd be very happy with a filter timeout, but if I don't have that I need an equivalent query > ingest pattern.

Thank you very much far any guidance!

@nblumhardt
Copy link
Member

Hi, and thanks for getting in touch.

select * and a search are currently handled differently (one produces a rows/columns rowset, while the other produces a stream of individual events), so the results will definitely differ, here.

Can you share any details of what the timeout looks like? We should be able to add this option pretty quickly to seqcli, but we'll need to know where the timeout is triggering (client-side or on the server). The exception/stack trace would help with this, and it would also be great to know exactly how long the command runs for before timing out.

Best regards,
Nick

@nblumhardt nblumhardt added the question Further information is requested label Mar 25, 2021
@jeffr1975
Copy link
Author

Thanks for the quick response Nick! Getting the ability to set a search timeout would be extremely useful!

..\seqcli-2021.2.447-win-x64\seqcli.exe search --server="https://seq:5341/" --apikey=xxx --start=2021-03-21T21:07:57.1631603-05:00 --end=2021-03-25T08:26:57.1641594-05:00 --count=200000 --filter="Application = 'XXX'" --json

..\seqcli-2021.2.447-win-x64\seqcli.exe : Could not retrieve search result: The request was canceled due to the configured HttpClient.Timeout of 100 seconds elapsing.

At line:1 char:1
..\seqcli-2021.2.447-win-x64\seqcli.exe search - ...

CategoryInfo          : NotSpecified: (Could not retri...conds elapsing.:String) [], RemoteException FullyQualifiedErrorId : NativeCommandError
**System.Threading.Tasks.TaskCanceledException: The request was canceled due to the configured HttpClient.Timeout of 100 seconds elapsing.**
---> System.TimeoutException: A task was canceled.
---> System.Threading.Tasks.TaskCanceledException: A task was canceled.
  at System.Net.Http.HttpConnection.ChunkedEncodingReadStream.CopyToAsyncCore(Stream destination, CancellationToken cancellationToken)
  at System.Net.Http.HttpConnectionResponseContent.SerializeToStreamAsync(Stream stream, TransportContext context, CancellationToken cancellationToken)
  at System.Net.Http.HttpContent.LoadIntoBufferAsyncCore(Task serializeToStreamTask, MemoryStream tempBuffer)
  at System.Net.Http.HttpClient.SendAsyncCore(HttpRequestMessage request, HttpCompletionOption completionOption, Boolean async, Boolean emitTelemetryStartStop, CancellationToken cancellationToken)
  --- End of inner exception stack trace ---
  --- End of inner exception stack trace ---
  at System.Net.Http.HttpClient.SendAsyncCore(HttpRequestMessage request, HttpCompletionOption completionOption, Boolean async, Boolean emitTelemetryStartStop, CancellationToken cancellationToken)
  at Seq.Api.Client.SeqApiClient.HttpSendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
  at Seq.Api.Client.SeqApiClient.PostAsync[TEntity,TResponse](ILinked entity, String link, TEntity content, IDictionary`2 parameters, CancellationToken cancellationToken)
  at Seq.Api.ResourceGroups.ApiResourceGroup.GroupPostAsync[TEntity,TResponse](String link, TEntity content, IDictionary`2 parameters, CancellationToken cancellationToken)
  at Seq.Api.ResourceGroups.EventsResourceGroup.InSignalAsync(SignalEntity unsavedSignal, SignalExpressionPart signal, String filter, Int32 count, String startAtId, String afterId, Boolean render, Nullable`1 fromDateUtc, Nullable`1 toDateUtc, Nullable`1 shortCircuitAfter, String
permalinkId, CancellationToken cancellationToken)
  at SeqCli.Cli.Commands.SearchCommand.Run() in C:\projects\seqcli\src\SeqCli\Cli\Commands\SearchCommand.cs:line 80

@nblumhardt
Copy link
Member

Perfect, thanks 👍

@nblumhardt nblumhardt added bug Something isn't working and removed question Further information is requested labels Mar 11, 2022
nblumhardt added a commit to nblumhardt/seqcli that referenced this issue Mar 15, 2022
@nblumhardt
Copy link
Member

The shipping feature uses the flag name --request-timeout, as there are multiple individual requests for result pages that this will apply to (it's not a timeout for the overall search operation).

@jeffr1975
Copy link
Author

Thank you for implementing this.

@nblumhardt
Copy link
Member

Thanks @jeffr1975 🙌 - you're welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants