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
Error in WaitForStateAsync is not wrapped #26
Comments
Hello, thanks for noticing I will take a look into it. |
Please note that the missing error wrapping affects all Wait* methods. |
can you be more specific, please? Are you referring to the fact that the error should be a specific type of error(like a waitForErr of type err) to figure out what type of error is and from where that error was thrown? |
The bug was solved and the new implementation will be able in the next release. |
@gabisavu-ionos The issue still isn't resolved in the current master. When will the next release land? |
The release is not made yet, I'm not sure when the release will be made, but I can inform you through a comment here or a message on chat. |
Could we keep this issue open until the fix is done? |
yes, sure |
Thanks |
Can be closed as https://github.com/ionos-cloud/sdk-go/releases/tag/v6.1.2 is out, I guess. |
The release also has issues but at least it addressed the ones mentioned here. |
Description
The error in this line is neither wrapped nor even formatted correctly which means that it cannot be handled.
Additionally, the
waitForStateWithChanel
has a typo and the async wait for state or deletion code has a few issues. Code execution continues past writing of the done and state channels. For example here:This pattern is found throughout the
waitForStateWithChanel
andwaitForDeletionWithChannel
functions.waitForDeletionWithChannel
even has a risk of NPE because theapiResponse
that is checked for nil here is then dereferenced a few lines after it.waitForStateWithChanel
has the issue that it will hang when an error occurs. A message is sent to thedone
channel here and eventually another gets sent here. This means that this function will never exit since the exit conditiondone
is checked on the next iteration and write to thedone
channel is blocked by it's size of 1.This can be prevent by simply adding some
continue
s or using anelse
block.See: https://go.dev/play/p/0ENsyvFU4Bf
The code looks auto-generated so I don't know if I should contribute a patch. Please let me know.
The text was updated successfully, but these errors were encountered: