-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Improvements for handling missed "meeting_ended" and "recording_ready" callbacks #5327
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scouillard
force-pushed
the
add-sync-jobs
branch
from
July 17, 2023 19:49
ff3601d
to
14a59a4
Compare
scouillard
force-pushed
the
add-sync-jobs
branch
from
July 17, 2023 20:52
32dec30
to
f277a81
Compare
scouillard
changed the title
Add meetings and recordings sync jobs
Improvements for handling missed "meeting_ended" and "recording_ready
Jul 17, 2023
scouillard
changed the title
Improvements for handling missed "meeting_ended" and "recording_ready
Improvements for handling missed "meeting_ended" and "recording_ready" callbacks
Jul 17, 2023
farhatahmad
reviewed
Jul 18, 2023
Since last review:
|
farhatahmad
reviewed
Jul 19, 2023
farhatahmad
reviewed
Jul 20, 2023
farhatahmad
reviewed
Jul 24, 2023
bin/poller
Outdated
Comment on lines
3
to
30
# Maximum number of attempts to connect to PostgreSQL | ||
max_attempts=3 | ||
|
||
# Time in seconds to wait between each attempt | ||
wait_seconds=10 | ||
|
||
# Current attempt number | ||
current_attempt=1 | ||
|
||
echo "Checking if PostgreSQL is ready..." | ||
|
||
while [ $current_attempt -le $max_attempts ] | ||
do | ||
nc -z postgres 5432 | ||
if [ $? -eq 0 ]; then | ||
echo "PostgreSQL is ready, starting the poller task shortly..." | ||
sleep 10 # additional 10 seconds to make sure that the database is ready to receive queries | ||
bundle exec rake poller:run_all | ||
exit 0 | ||
fi | ||
|
||
echo "PostgreSQL is not ready, retrying in $wait_seconds seconds..." | ||
current_attempt=$(( current_attempt+1 )) | ||
sleep $wait_seconds | ||
done | ||
|
||
echo "Failed to connect to PostgreSQL after $max_attempts attempts, exiting." | ||
exit 1 |
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.
Consistency with bin/start
would be nice here. bin/start
retries forever until Postgres starts up, so I would follow the logic there
Kudos, SonarCloud Quality Gate passed! |
farhatahmad
approved these changes
Jul 25, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR addresses an issue where Recordings and Room status would be out of sync with the BBB server when the "meeting_ended" and/or "recording_ready" callbacks miss.
Two rake tasks are now introduced,
meetings_poller
andrecordings_poller
, which periodically check the status of meetings and recordings.meetings_poller
reaches the BBB server to confirm every meeting whereonline: true
are truly online. This verification provides an additional layer of assurance and data consistency in case we fail to receive or process the "meeting_ended" callbacks. It is also needed for the task above.recordings_poller
reaches the BBB server to fetch the recordings for every meeting that recently ended. If any recordings are not present in our system but exist on the server, they are added to our database, ensuring we maintain an up-to-date list of recordings even if we miss the "recordings_ready" callbacks.The Trigger
A new service named
greenlight-v3-poller
has been introduced in our docker-compose setup. This service is essentially a clone of greenlight-v3, designed specifically to run these polling tasks.The entry point for this service is set to bin/poller that is a script that triggers the rake tasks when the application is built.
NOTE: The trigger has not been tested yet.