Skip to content

Comments

Add a method to TaskHandle to ensure tokio JoinSets are awaited#925

Closed
Cictrone wants to merge 1 commit intomainfrom
fix_fast_time_hang
Closed

Add a method to TaskHandle to ensure tokio JoinSets are awaited#925
Cictrone wants to merge 1 commit intomainfrom
fix_fast_time_hang

Conversation

@Cictrone
Copy link
Collaborator

@Cictrone Cictrone commented May 4, 2025

Even though the tokio JoinSet docs claim

The provided future will start running in the background immediately
when this method is called, even if you don't await anything on this
`JoinSet`.

We are seeing some sort of race condition on faster tomes where this behavior is not occurring(and thus the JoinSet for reporting back output is never executing). To fix this I added a join method for TaskHandle so that way in the Agent.report method we can call it on finished TaskHandles. This should be safe from hanging the thread as is_finished (which is called before) ensures that the pool is empty and the Runtime's JoinHandle is finsihed.

/kind bug
Fixes #754

@Cictrone
Copy link
Collaborator Author

Cictrone commented May 4, 2025

this fix option does hang on pivot.reverse_shell as that function will "complete" but the tokio task will continue for the length of the shell. Thus is_finished returns true even while the shell is alive. as such we wont be merging this solution but will use the one in #924 instead.

@Cictrone Cictrone closed this May 4, 2025
@Cictrone Cictrone deleted the fix_fast_time_hang branch May 4, 2025 01:55
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

Successfully merging this pull request may close these issues.

Tomes that finish fast fail to respond when another task is blocking IO

2 participants