-
Notifications
You must be signed in to change notification settings - Fork 42
Script Status Improvements #2035
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
base: main
Are you sure you want to change the base?
Conversation
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2035 +/- ##
==========================================
+ Coverage 76.87% 78.35% +1.48%
==========================================
Files 638 618 -20
Lines 47462 46104 -1358
Branches 754 754
==========================================
- Hits 36486 36125 -361
+ Misses 10893 9896 -997
Partials 83 83
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
# Also need to cleanup the status model in this case because the process will not die and cleanup | ||
running_script.state = "killed" | ||
running_script.update | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Were we just leaving zombie processes before with the RunningScript.delete
by itself?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Potentially. Though most of the time I think they were not really there due to a container restart.
@@ -343,18 +302,42 @@ def self.spawn(scope, name, suite_runner = nil, disconnect = false, environment | |||
model = OpenC3::OfflineAccessModel.get_model(name: username, scope: scope) if username and username != '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't need the if username
check anymore because you're always setting it to Anonymous
above if it's not set
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will change to check for not Anonymous.
updated_at: nil, # Set by create/update - ISO format | ||
scope: scope # Scope of the script | ||
) | ||
script_status.create(isoformat: true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love the docs here!
What is the point of the (*)
after the comments?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The * was just notes to myself on which items to make sure get updated while running. Will remove.
# Capture STDOUT and STDERR | ||
$stdout.add_stream(@output_io) | ||
$stderr.add_stream(@output_io) | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this just go away?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're always running so this was dead code.
end | ||
|
||
def is_complete? | ||
return (@state == 'complete' or @state == 'complete_errors' or @state == 'stopped' or @state == 'crash' or @state == 'killed') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the difference between complete
and stopped
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
complete = got all the way through the script without errors
stopped = stopped prematurely
undeploy() | ||
self.class.store.hdel(@primary_key, @name) | ||
# Also remove from ordered set | ||
self.class.store.zremrangebyscore(@primary_key + "__LIST", @name.to_f - 0.1, @name.to_f + 0.1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@name
is the PID? Isn't this an integer? Do you have to do the +- 0.1 or does it work with just the @name.to_i
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Name is the script id not PID.
Redis store values are floats, so I figured it would safer with the range rather than exact match.
Still needs:
Python changes
Updates to Running/Completed Script Display
Minor updates to backend apis (for pagination)
Minor updates to script apis (for pagination)
ScriptRunner restore running script
ScriptRunner emit running script id on start