Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eliminate script zombies. Fix python output thread. Default CI to empty string #1903

Merged
merged 1 commit into from
Feb 17, 2025

Conversation

ryanmelt
Copy link
Member

closes #1503

@ryanmelt ryanmelt requested a review from jmthomas February 17, 2025 00:46
Copy link

codecov bot commented Feb 17, 2025

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 79.44%. Comparing base (92b60ed) to head (f187935).
Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
...mos-script-runner-api/app/models/running_script.rb 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1903      +/-   ##
==========================================
+ Coverage   79.42%   79.44%   +0.01%     
==========================================
  Files         523      523              
  Lines       40926    40927       +1     
==========================================
+ Hits        32506    32514       +8     
+ Misses       8420     8413       -7     
Flag Coverage Δ
python 84.02% <ø> (+0.05%) ⬆️
ruby-api 48.44% <0.00%> (-0.02%) ⬇️
ruby-backend 82.55% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -396,6 +396,7 @@ def self.spawn(scope, name, suite_runner = nil, disconnect = false, environment
process.environment['RUBYOPT'] = nil # Removes loading bundler setup
process.environment['OPENC3_SCOPE'] = scope

process.detach = true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This prevents zombie processes?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Detaching means that the spawning process is not responsible for waiting for the child to die and check the exit status.

@@ -1223,7 +1225,7 @@ def output_thread_body(self):
while True:
if RunningScript.cancel_output:
break
if (time.time() - self.output_time) > 5.0:
if (time.time() - self.output_time_value) > 5.0:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did my refactor break this or was it always broke?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know.

@ryanmelt ryanmelt merged commit 265fa8a into main Feb 17, 2025
30 checks passed
@ryanmelt ryanmelt deleted the no_script_zombies branch February 17, 2025 05:52
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.

The ScriptRunner container leaves dead processes in the process list (ps -ef)
2 participants