Skip to content

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

@hulto

Description

@hulto

Describe the bug
When a tome is performing an IO blocking operation like: sleeping, or making a network connection it can prevent other tomes from sending output back to tavern.
This only seems to affect tomes that finish quickly (likely within the time between claim_task and report.)
"fast" Tomes that have had this issue:

  • Get env
  • Shell execute cmd: id
  • Process list match: *

/realm/implants/imix/src/agent.rs:78

    /*
     * Callback once using the configured client to claim new tasks and report available output.
     */
    pub async fn callback(&mut self) -> Result<()> {
        let transport = GRPC::new(self.cfg.callback_uri.clone(), self.cfg.proxy_uri.clone())?;
        self.claim_tasks(transport.clone()).await?;
        self.report(transport.clone()).await?;

        Ok(())
    }

To Reproduce

  1. Create an IO blocking tome:
def main():
    time.sleep(999999)

main()
  1. Import it to tavern - I temporarily replaced realm/tavern/tomes/example/main.eldritch with the above and the start tavern.
  2. Run a "fast" tome to make sure it works
  3. Run the IO blocking tome
image
  1. Run a "fast" tome again and see how it stays in the Queued state
image
  1. Run a slow tome and see that it finishes as expceted
image

Expected behavior
Tomes should never interfere with each other. Even if a tome is infinitely blocking other tomes should be able to complete.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingimix

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions