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

Remove changing mode of files by ext_job #2784

Merged
merged 1 commit into from
Feb 10, 2022

Conversation

ManInFez
Copy link
Contributor

@ManInFez ManInFez commented Jan 26, 2022

Issue
Resolves #1907

Pre review checklist

  • Added appropriate labels

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

@ManInFez ManInFez self-assigned this Jan 26, 2022
@codecov-commenter
Copy link

codecov-commenter commented Jan 26, 2022

Codecov Report

Merging #2784 (88590d1) into main (e5fa49c) will decrease coverage by 0.03%.
The diff coverage is 20.00%.

Impacted file tree graph

@@            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     
Impacted Files Coverage Δ
libres/lib/job_queue/ext_job.cpp 62.46% <20.00%> (-1.77%) ⬇️
libres/lib/job_queue/ext_joblist.cpp 61.90% <0.00%> (-3.18%) ⬇️
libres/lib/res_util/block_fs.cpp 53.38% <0.00%> (-0.59%) ⬇️
libres/lib/analysis/update.cpp 40.51% <0.00%> (+0.25%) ⬆️
libres/lib/enkf/gen_kw.cpp 59.51% <0.00%> (+0.48%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e5fa49c...88590d1. Read the comment docs.

@oyvindeide
Copy link
Collaborator

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?

@ManInFez
Copy link
Contributor Author

Looks like a good change +1 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

fprintf(stderr,

@oyvindeide
Copy link
Collaborator

Looks like a good change +1 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

fprintf(stderr,

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)?

@oyvindeide
Copy link
Collaborator

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.

@ManInFez ManInFez added the release-notes:breaking-change Automatically categorise as breaking change in release notes label Jan 28, 2022
@ManInFez
Copy link
Contributor Author

test libres please!

@ManInFez
Copy link
Contributor Author

test ert please!

Copy link
Collaborator

@oyvindeide oyvindeide left a 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?

libres/lib/job_queue/ext_job.cpp Outdated Show resolved Hide resolved
@ManInFez ManInFez force-pushed the remove_change_mod_in_ext_job branch 3 times, most recently from 5c55280 to 93539d5 Compare January 31, 2022 11:01
Set executable on job scripts created in tests

Raise exception in ext_job.cpp when executable is not valid

Add ext_job executable tests
@ManInFez
Copy link
Contributor Author

ManInFez commented Feb 1, 2022

test ert please!

Copy link
Collaborator

@oyvindeide oyvindeide left a 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?

@ManInFez
Copy link
Contributor Author

ManInFez commented Feb 7, 2022

There is now a clear warning in the console if this occurs so a great improvement +1 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.

@oyvindeide
Copy link
Collaborator

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.

@ManInFez
Copy link
Contributor Author

ManInFez commented Feb 9, 2022

I would prefer to not change this behaviour in this PR, but I can make an issue for it?

@ManInFez ManInFez merged commit 839b48a into equinor:main Feb 10, 2022
@ManInFez ManInFez deleted the remove_change_mod_in_ext_job branch February 10, 2022 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-notes:breaking-change Automatically categorise as breaking change in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stop changing the permissions of job executables
3 participants