Conversation
|
Looks like there's a CI failure: |
There was a problem hiding this comment.
Pull request overview
This PR attempts to make Rex::IO::RelayManager reusable across multiple runs by resetting the underlying Rex::IO::FiberScheduler state when the manager thread exits.
Changes:
- Call
@scheduler.reset!whenRelayManager#runfinishes (inensure). - Introduce
FiberScheduler#reset!to clear internal queues/maps and recreate the urgent signaling pipe.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| lib/rex/io/relay_manager.rb | Resets the scheduler after the scheduler thread finishes running. |
| lib/rex/io/fiber_scheduler.rb | Adds reset! to clear scheduler state and recreate the urgent wakeup pipe. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
|
Looks like that CI failure was a fluke. Rerunning the tests switched it to passing. I don't know about all of these copilot suggestions. It seems pretty intuitive to me that if you |
dledda-r7
left a comment
There was a problem hiding this comment.
Changes looks good to me
This adds a
#reset!method to theFiberSchedulerclass, which will reset the object back to its initial state. This is necessary if the scheduler will be used again as is the case in the RelayManager. If one or more relays are added then they all exit, the scheduler needs to be reset before it can be used again. This fixes a bug where the relays all exit, then more relays are added. Between the exit of the original relays and the new ones being added, the scheduler was left in a closed state so the new relays were never being processed.