pysipp icon indicating copy to clipboard operation
pysipp copied to clipboard

`trio` subprocs launching

Open goodboy opened this issue 3 years ago • 6 comments

Replacement for #55 after going through the slew of merge conflicts.

From that issue verbatim here is the original description:

ping @linuxmaniac


This is in preparation of a python 3.6+ only 1.0.0.alpha release and replaces all the internal processing launching machinery with the new subprocess support in trio.

This not only gets us cross OS support for free but also gives access to async/await based scenario and agent spawning.

A few interesting notes:

  • SIPp turns out to be a good fit with trio cancellation semantics since it has a built in cancellation system via SIGUSR1
  • this now gives us a strictly single threaded implementation
  • trio gives us deterministic teardown allowing for much finer control over per agent failures and subsequent reporting

TODO:

  • [ ] adjust to the new trio proc spawning APIs and get CI running clean, also see
    • https://github.com/python-trio/trio/pull/1568 -> we need to pin to the appropriate trio version that this was merged to.
    • [ ] i think we want the process = await nursery.start(trio.run_process, ...) form yah?
  • [ ] write some async spawning tests and examples in the readme
  • do we need this right away or can we add it in a follow up?
  • consider playing around with timeout and other cancellation tools such as trio.move_on_after() and trio.fail_after() and figure out how this can interplay with log reporting for interactive use
  • [ ] add the mac os env to CI

I look forward to feedback and thoughts!

goodboy avatar Dec 18 '22 20:12 goodboy

Looks like I've broken something using the new spawn api, not sure what.

I don't have the sipp binary installed locally atm so if someone wants to take a shot at repairing this (hint hint @linuxmaniac) please feel free!

goodboy avatar Dec 18 '22 21:12 goodboy

BTW, some of the commits don't pass the pre-commit checks.

when rebasing, you should do git rebase -x 'pre-commit run --from HEAD^ --to HEAD' origin/master in order to force the execution of pre-commit checks per commit

linuxmaniac avatar Dec 19 '22 19:12 linuxmaniac

@linuxmaniac RE all the little changes you suggest, can you make a PR onto this branch to fix them if you've already gone through it?

goodboy avatar Dec 19 '22 22:12 goodboy

@linuxmaniac RE all the little changes you suggest, can you make a PR onto this branch to fix them if you've already gone through it?

There you are https://github.com/SIPp/pysipp/pull/88

linuxmaniac avatar Dec 19 '22 23:12 linuxmaniac

@linuxmaniac landed it 🏄🏼

goodboy avatar Dec 20 '22 19:12 goodboy

There rebased clean to master.

goodboy avatar Dec 20 '22 19:12 goodboy