-
Notifications
You must be signed in to change notification settings - Fork 104
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
Remove changing mode of files by ext_job #2784
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2784 +/- ##
==========================================
- Coverage 65.21% 65.18% -0.04%
==========================================
Files 653 653
Lines 53496 53492 -4
Branches 4790 4802 +12
==========================================
- Hits 34887 34868 -19
- Misses 17006 17012 +6
- Partials 1603 1612 +9
Continue to review full report at Codecov.
|
Looks like a good change 👍 Because this might cause some workflows and forward models to fail because they rely on this behavior, how does this fail if we dont have execute permission, is the error message understandable? |
It outputs an error message saying you do not have execution rights to this file ert/libres/lib/job_queue/ext_job.cpp Line 444 in ac2ea6e
|
It does not mention that the file could have been found, but did not have the correct rights though, maybe add that as well? Or check if the file is found, check the rights, and if not found, throw the very appropriate error (or print as it appears we do, though and error is probably better)? |
The reason I am asking so much is I once ended up trying to debug when this happened, and was not the first thing I thought of, so took me some time to figure out. |
77abb63
to
f0e0741
Compare
test libres please! |
test ert please! |
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.
Looks good, just running some checks, would it make sense to add a test to this?
5c55280
to
93539d5
Compare
Set executable on job scripts created in tests Raise exception in ext_job.cpp when executable is not valid Add ext_job executable tests
93539d5
to
88590d1
Compare
test ert please! |
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.
There is now a clear warning in the console if this occurs so a great improvement 👍 It is only a warning though, and cant quite agree with myself if I think it should be an error. If you try to actually use the forward model, you will get an error, but then it is not so clear, you have to put it in context with the previous warnings, for example you get:
Error message: ext_joblist_get_job_copy: asked for job:MY_CUSTOM_JOB which does not exist
See file: /tmp/ert_abort_dump.log for more details of the crash.
Setting the environment variable "ERT_SHOW_BACKTRACE" will show the backtrace on stderr.
then the warning is higher in the console:
Error parsing executable: ** You do not have execute rights to: /some/path/MY_CUSTOM_JOB** Warning: job: 'MY_CUSTOM_JOB' not available ...
maybe it would be better to error right away?
This will cause the python constructor to segfault when something is wrong, as it will not be able to capture the exception. I think the scope of the issue becomes a little too large for this PR. |
I know, it is not ideal, but it ends up doing that anyway when it ulimately calls `util_abort, and the message just becomes a bit less clear because it says it did not find the job. Could for catch the exceptions and accumulate them before reraising with the full message. And either not catch it at all, or recatch even higher up. |
I would prefer to not change this behaviour in this PR, but I can make an issue for it? |
Issue
Resolves #1907
Pre review checklist
Adding labels helps the maintainers when writing release notes, see sections and the
corresponding labels here: https://github.com/equinor/ert/blob/main/.github/release.yml