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
MediaLive waitUntilInputDeleted does not work. #5125
Comments
@cobar79 to clarify, your ask is for the waiter Let me know if I'm missing something. |
@debora-ito |
Ok, so I think what's missing here is a waiter for Input Security Group. 'waitUntilInputDelete' seems to be working as expected, its success condition is DELETED, not DETACHED, so the waiter will keep calling DescribeInput while the status is different than DELETED, and time out in this case. According to the possible values of InputState, after calling DeleteInput it can move from DETACHED to DELETING (even very briefly) then to DELETED. That's why this waiter exists, the input can be on DELETING state for a while. As you noticed, there's no waiters for Input Security Groups, so as a workaround you can poll it manually - here's a very simplistic example: int attemptNumber = 0;
//manually polling InputSecurityGroup
while (attemptNumber < 20) {
DescribeInputSecurityGroupResponse describeResponse =
mediaLiveClient.describeInputSecurityGroup(s-> s.inputSecurityGroupId(INPUT_SECGROUP_ID));
if (describeResponse.state().equals(InputSecurityGroupState.IDLE)) {
break;
}
Thread.sleep(500);
attemptNumber++;
}
mediaLiveClient.deleteInputSecurityGroup(d->d.inputSecurityGroupId(INPUT_SECGROUP_ID)); In the meantime, I'll reach out to the MediaLive team and ask them to add waiters for Input Security Groups to the model. Let us know if this helps. |
Agree that there should be a waiter on Input Security Group. I still believe the Input Waiter is broken since I always get
I didn't attempt to override the backoff strategy. Will try the workaround but |
I implemented the manual wait on the input security group. However, it is won't be reached or work since the input delete fails maxAttempts. This should not be failing since the input is already Detached? It takes very little time to delete it in the console. In fact I bumped the waitTimeout to 3 minutes, jumped in the console and manually deleted the input and the waiter finished and deleted the input security group via the SDK.
|
To confirm I understand the steps you are taking: (1) Input is in DETACHED state ? |
Describe the bug
When using MediaLive waitUntilInputDeleted when the input is in a "Detached" state, the input is not deleted and the request times out.
When directly deleting the mediaLiveClient.deleteInput(DeleteInputRequest.builder().inputId(inputId).build()); the input is deleted.
However, this makes the deletion of the Input Security Group fail because it is not Idle.
I did search for MediaLiveWaiter waitUntilInputSecurityGroupIdle but it does not seem to exist.
Expected Behavior
The MediaLive input should be immediately deleted since it is in a Detached state and not time out. This would insure that the Security Group is Idle and able to be deleted.
Current Behavior
software.amazon.awssdk.core.exception.SdkClientException: The waiter has exceeded the max retry attempts: 21
Subsequently, you have to enter the console and delete the detached Input, wait a few seconds and delete the Security group once it is Idle.
Reproduction Steps
See
Run MediaLiveServiceTests whenCreateChannel_givenChannelRequest_thenCreateChannel
Failure occurs because it is unclear where to set the Archive S3 URL in the SDK.
Archive group destination A
Enter a destination for archiving your first group.
URL s3://<bucket>/<folder>/<file-prefix>
Video Service App GitHub
Possible Solution
Fix waitUntilInputDeleted to delete the Detached Input
Add waitUntilInputSecurityGroupIdle functionallity
Additional Information/Context
No response
AWS Java SDK version used
2.25.14
JDK version used
Corretto-17.0.7.7.1 (build 17.0.7+7-LTS)
Operating System and version
Windows 10
The text was updated successfully, but these errors were encountered: