Skip to content
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
merged 12 commits into from
Jul 25, 2023

Conversation

scouillard
Copy link
Contributor

@scouillard scouillard commented Jul 11, 2023

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 and recordings_poller, which periodically check the status of meetings and recordings.

meetings_poller reaches the BBB server to confirm every meeting where online: 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.

@scouillard scouillard added the v3 label Jul 11, 2023
@scouillard scouillard changed the title Initial commit Add meetings and recordings sync jobs Jul 11, 2023
@scouillard scouillard marked this pull request as draft July 11, 2023 22:18
@scouillard scouillard marked this pull request as ready for review July 17, 2023 20:51
@scouillard scouillard changed the title Add meetings and recordings sync jobs Improvements for handling missed "meeting_ended" and "recording_ready Jul 17, 2023
@scouillard 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
docker-compose.yml Show resolved Hide resolved
lib/tasks/poller.rake Outdated Show resolved Hide resolved
lib/tasks/poller.rake Outdated Show resolved Hide resolved
lib/tasks/poller.rake Outdated Show resolved Hide resolved
lib/tasks/poller.rake Outdated Show resolved Hide resolved
lib/tasks/poller.rake Outdated Show resolved Hide resolved
@scouillard
Copy link
Contributor Author

Since last review:

  • remove provider scope, rework RecordingCreator service
  • add disabled_recordings query to sort out providers with record disabled in the recent_meeting query
  • add logs

lib/tasks/poller.rake Outdated Show resolved Hide resolved
lib/tasks/poller.rake Outdated Show resolved Hide resolved
lib/tasks/poller.rake Outdated Show resolved Hide resolved
docker-compose.yml Outdated Show resolved Hide resolved
docker-compose.yml Outdated Show resolved Hide resolved
lib/tasks/poller.rake Outdated Show resolved Hide resolved
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
Copy link
Collaborator

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

@sonarcloud
Copy link

sonarcloud bot commented Jul 25, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@farhatahmad farhatahmad merged commit 8cbf782 into bigbluebutton:master Jul 25, 2023
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants