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
[BEAM-8119] Properly cleanup Pubsub in release script #9534
Conversation
release/src/main/python-release/run_release_candidate_python_quickstart.sh
Show resolved
Hide resolved
3da64a5
to
2b3599c
Compare
gcloud pubsub topics delete --project=$PROJECT_ID $PUBSUB_TOPIC2 | ||
gcloud pubsub subscriptions delete --project=$PROJECT_ID $PUBSUB_SUBSCRIPTION | ||
# Suppress error since topic/subscription may not exist | ||
gcloud pubsub topics delete --project=$PROJECT_ID $PUBSUB_TOPIC1 2> /dev/null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also suppress standard output?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no message to stdout by calling gcloud pubsub topics create/delete
(whether succeeds or not).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If succeed, it will show messages like
"Created topic [projects/apache-beam-testing/topics/wordstream-python-topic-1]."
"Deleted topic [projects/apache-beam-testing/topics/wordstream-python-topic-1]."
If fail, it will raise something like "ERROR: The topic XXXX does not exist".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right, those messages go to standard error which is suppressed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also the main purpose to suppress stderr here is not to break the script. Messages in stdout can help people know the status of current step.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Got an LGTM. I'll go ahead to merge it before 2.16 branch cut. |
Unexpected script failure will leak pubsub topics and fail the next run if no manual cleanup. We want to do cleanup every time before create the topics and also do cleanup when script exists.
Tested manually.
+R: @yifanzou
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
R: @username
).[BEAM-XXX] Fixes bug in ApproximateQuantiles
, where you replaceBEAM-XXX
with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.Post-Commit Tests Status (on master branch)
Pre-Commit Tests Status (on master branch)
See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.