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

Handle exception while distributer not availble #219

Merged
merged 20 commits into from
Feb 15, 2024

Conversation

shamlymajeed
Copy link
Contributor

Summary: closes #218

Related issue:

Suggested reviewer(s):

Reviewer checklist:

  • The headers of all files contain a reference to the repository license
  • 100% test coverage of new code - meaning:
    • The overall test coverage increased or remained the same as before
    • Every function is accompanied with a test suite
    • Tests are both positive (testing that the function work as intended with valid data) and negative (testing that the function behaves as expected with invalid data, e.g., that correct exceptions are thrown)
    • Functions with optional arguments have separate tests for all options
  • Examples are supported by doctests
  • All tests are passing
  • All names (e.g., files, classes, functions, variables) are explicit
  • Documentation (as docstrings) is complete and understandable

The checklist is based on the S-ENDA conventions and definition of done (see General Conventions). The above points are not necessarily relevant to all contributions. In that case, please add a short explanation to help the reviewer.

 - verify whether the files are removed from workdir if any of the distributers fail or all distributers succeed.
 - Handled exceptions due to unavailabilty of distributers.
 - If any of the distributers is unavailable while distribution, api throws a 503 exception, so mmd-agent can retry sending that file later.
 - Fixed a test error.
…overage.

 -Handled unavailabity of distributer in delete endpoint also.
 -Added test cases to test the exception handling while distributer is unavailable .
 -Improved test coverage.
@shamlymajeed shamlymajeed requested a review from mortenwh January 25, 2024 21:37
@shamlymajeed shamlymajeed self-assigned this Jan 25, 2024
Copy link
Collaborator

@mortenwh mortenwh left a comment

Choose a reason for hiding this comment

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

We need to wok on the distribute function. See comments. Also, the errors seem to occur in dmci/distributors/distributor.py. As such, the error handling should be done there.

dmci/api/worker.py Outdated Show resolved Hide resolved
dmci/api/worker.py Outdated Show resolved Hide resolved
dmci/api/worker.py Outdated Show resolved Hide resolved
dmci/api/worker.py Outdated Show resolved Hide resolved
dmci/api/worker.py Outdated Show resolved Hide resolved
dmci/api/worker.py Outdated Show resolved Hide resolved
shamlymajeed and others added 2 commits February 1, 2024 15:08
Co-authored-by: Morten W. Hansen <109061+mortenwh@users.noreply.github.com>
 -If any distributor is not available `status` becomes `False`, and moved to rejected.
 -improved test coverage.
@shamlymajeed shamlymajeed requested a review from mortenwh February 7, 2024 08:02
Copy link
Collaborator

@mortenwh mortenwh left a comment

Choose a reason for hiding this comment

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

Some changes needed..

dmci/api/app.py Outdated Show resolved Hide resolved
dmci/api/worker.py Outdated Show resolved Hide resolved
dmci/api/worker.py Outdated Show resolved Hide resolved
dmci/api/worker.py Outdated Show resolved Hide resolved
dmci/distributors/pycsw_dist.py Show resolved Hide resolved
tests/test_api/test_app.py Outdated Show resolved Hide resolved
tests/test_api/test_app.py Outdated Show resolved Hide resolved
tests/test_dist/test_pycsw_dist.py Outdated Show resolved Hide resolved
tests/test_dist/test_pycsw_dist.py Outdated Show resolved Hide resolved
tests/test_dist/test_pycsw_dist.py Outdated Show resolved Hide resolved
shamlymajeed and others added 10 commits February 7, 2024 11:39
Co-authored-by: Morten W. Hansen <109061+mortenwh@users.noreply.github.com>
Co-authored-by: Morten W. Hansen <109061+mortenwh@users.noreply.github.com>
Co-authored-by: Morten W. Hansen <109061+mortenwh@users.noreply.github.com>
Co-authored-by: Morten W. Hansen <109061+mortenwh@users.noreply.github.com>
Co-authored-by: Morten W. Hansen <109061+mortenwh@users.noreply.github.com>
Co-authored-by: Morten W. Hansen <109061+mortenwh@users.noreply.github.com>
@shamlymajeed shamlymajeed requested a review from mortenwh February 7, 2024 12:27
Copy link
Collaborator

@mortenwh mortenwh left a comment

Choose a reason for hiding this comment

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

One small thing and then it's good - thanks!

dmci/distributors/pycsw_dist.py Outdated Show resolved Hide resolved
@mortenwh mortenwh merged commit 222655a into main Feb 15, 2024
7 checks passed
@mortenwh mortenwh deleted the Handle_exception_while_distributer_not_availble branch February 15, 2024 20:14
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.

Handle the exception in dmci if any of the distibuters not available.
2 participants