esrlabs / chipmunk

log analysis tool
Apache License 2.0
553 stars 39 forks source link

Sessions: Cancel other tasks on operation errors #2049

Closed AmmarAbouZor closed 2 months ago

AmmarAbouZor commented 2 months ago

This PR makes sure that cancel call will be invoked on the cancellation token instance if running producer returns with an operation error to avoid having the app stuck in join!() calls since some tasks like tail::track() won't return until cancel is called.

For Example the current Implementation won't show any error message in indexer_cli tool if run_source() call returns an error because it will be waiting for tail::track() to finish, which won't finish in that case until the user closes the session manually, and then at that point the error message will be printed.

DmitryAstafyev commented 2 months ago

Thanks @AmmarAbouZor . That's a very good find, @marcmo. Actually if our observation method is stuck for some reason we are losing a way to report it back because of tailing. This issue is relevant for file cases, and other use cases not affected.

AmmarAbouZor commented 2 months ago

Linting issues from the updated has been fixed by suppressing the unused warning since the value can be used in the futures