GoogleCloudPlatform / healthcare-dicom-dicomweb-adapter

Adapter which transforms DIMSE requests to DICOMweb requests
Apache License 2.0
119 stars 48 forks source link

BackupUploadService with LocalBackupUploader added. #98

Closed oleksii-opanasenko closed 4 years ago

oleksii-opanasenko commented 4 years ago

The BackupUploadService added to CStoreService. Logic added to 'processorList' chain of the 'store' method. File is saving to backup (local in this PR) before sending. If upload fails - then we start resend it with timeout repeatedly until the first successful result. It repeats fixed amount of times (by flag). New configuration flags: --persistent_file_storage_location --persistent_file_upload_retry_amount --min_upload_delay --max_waiting_time_btw_uploads If resend processing fails- then we log it and fixing to MonitoringService. Added unit tests: DelayCalculatorTest LocalBackupUploaderTest BackupStateTest BackupUploadServiceTest

google-cla[bot] commented 4 years ago

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

oleksii-opanasenko commented 4 years ago

@googlebot I signed it!

On Mon, Jul 27, 2020 at 4:29 PM google-cla[bot] notifications@github.com wrote:

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.

What to do if you already signed the CLA Individual signers

Corporate signers

ℹ️ Googlers: Go here https://goto.google.com/prinfo/https%3A%2F%2Fgithub.com%2FGoogleCloudPlatform%2Fhealthcare-dicom-dicomweb-adapter%2Fpull%2F98 for more info.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/GoogleCloudPlatform/healthcare-dicom-dicomweb-adapter/pull/98#issuecomment-664366489, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQJZF3JSQLTRB2R6XBLDEB3R5VXK5ANCNFSM4PIW4F3A .

-- [image: Zazmic] Oleksii Opanasenko java developer - Zazmic Inc. Georgia (+995) 555-461-499

-

google-cla[bot] commented 4 years ago

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

google-cla[bot] commented 4 years ago

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

google-cla[bot] commented 4 years ago

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

pavertomato commented 4 years ago

@googlebot I signed it!

@oleksii-opanasenko all commits in pull request have to be signed with email which were used to sign cla, simplest way to fix your case is squash all commits into single one with correct email https://www.internalpointers.com/post/squash-commits-into-one-git git rebase --interactive ceb0c07b18 git commit --amend --author="Oleksii Opanasenko <cla-email@mail.mail>"

google-cla[bot] commented 4 years ago

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

google-cla[bot] commented 4 years ago

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

google-cla[bot] commented 4 years ago

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

google-cla[bot] commented 4 years ago

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

google-cla[bot] commented 4 years ago

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

google-cla[bot] commented 4 years ago

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

google-cla[bot] commented 4 years ago

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

oleksii-opanasenko commented 4 years ago

@googlebot I signed it!

google-cla[bot] commented 4 years ago

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

danielbeaudreau commented 4 years ago

Thanks, a few last small suggestions then this will be good to submit. I need to get the presubmit checks running for this code too and confirm if we can use Mockito

Re: "But this approach adds new risks on situation when --persistent_file_storage_location is set -> BackupUploadService created: if local or GCP uploader fails on read / write to backup file, then file will not be uploaded.", yes that's true, but I think this risk is preferable to buffering the file into memory which will likely lead to OOM failures at a high QPS. It was a conscious decision we made in the design of this feature.

"and it`s OutputStream will be empty or in invalid state." as far as I can tell our processStream code in CstoreService.java should prevent this from happening. Did you reproduce this during testing?

oleksii-opanasenko commented 4 years ago

@oleksii-opanasenko all commits in pull request have to be signed with email which were used to sign cla, simplest way to fix your case is squash all commits into single one with correct email https://www.internalpointers.com/post/squash-commits-into-one-git git rebase --interactive ceb0c07b18 git commit --amend --author="Oleksii Opanasenko <cla-email@mail.mail>"

Thanks for advice, Egor.

oleksii-opanasenko commented 4 years ago

@googlebot I fixed it.