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

Fix attach to job that exits immediately #2086

Merged
merged 2 commits into from
Apr 13, 2021
Merged

Fix attach to job that exits immediately #2086

merged 2 commits into from
Apr 13, 2021

Conversation

romasku
Copy link
Contributor

@romasku romasku commented Apr 12, 2021

No description provided.

# - wrong usage api usage (checked by tests)
# - container already stopped, so we can ignore such error

if e.status != 400:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can also use special HTTP status for this case (409 CONFLICTor 410 GONE may be relevant), but it is somewhat hacky.

Copy link
Contributor

@asvetlov asvetlov Apr 12, 2021

Choose a reason for hiding this comment

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

410 Gone sounds really good. I'd like to distinguish 'bad request data' and 'job is already finished'.

Maybe 404 Not Found is the better alternative? At least we use this status for similar situations, isn't it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, 404 also sounds like a good idea to me. Sometimes the best option is the simplest one:)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

PR to platform monitoring: neuro-inc/platform-monitoring#377

@codecov
Copy link

codecov bot commented Apr 12, 2021

Codecov Report

Merging #2086 (6c80c7c) into master (8db11c7) will decrease coverage by 0.91%.
The diff coverage is 50.00%.

❗ Current head 6c80c7c differs from pull request most recent head a9cb3bf. Consider uploading reports for the commit a9cb3bf to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2086      +/-   ##
==========================================
- Coverage   86.79%   85.88%   -0.92%     
==========================================
  Files          63       63              
  Lines       10030    10034       +4     
  Branches     1581     1583       +2     
==========================================
- Hits         8706     8618      -88     
- Misses       1015     1113      +98     
+ Partials      309      303       -6     
Flag Coverage Δ
cli 63.94% <25.00%> (-0.03%) ⬇️
e2e 65.75% <50.00%> (-0.95%) ⬇️
sdk 89.02% <ø> (ø)

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

Impacted Files Coverage Δ
neuro-cli/src/neuro_cli/ael.py 48.57% <50.00%> (-16.02%) ⬇️
neuro-cli/src/neuro_cli/formatters/jobs.py 79.60% <0.00%> (-2.13%) ⬇️
neuro-sdk/src/neuro_sdk/jobs.py 92.46% <0.00%> (-1.23%) ⬇️
neuro-cli/src/neuro_cli/job.py 79.54% <0.00%> (-1.15%) ⬇️
neuro-cli/src/neuro_cli/root.py 90.71% <0.00%> (+1.09%) ⬆️

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 8db11c7...a9cb3bf. Read the comment docs.

@romasku romasku merged commit 6f1bf88 into master Apr 13, 2021
@romasku romasku deleted the rs/fix-attach branch April 13, 2021 07:16
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.

2 participants