Possible race condition when enabling TLS

Bug #1982276 reported by Anton Troyanov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Triaged
Low
Unassigned

Bug Description

When MAAS CLI is used to configure TLS, it updates configuration in the database. After database values are changed, trigger will raise NOTIFY event, and all regiond services will handle it (using PostgreSQL LISTEN). Once handled, regiond service will render correct nginx config file and restart nginx.

There is a chance when regiond might miss that event:
1. regiond is starting. On start it reads existing config
*it takes some time to start up all the services

2. CLI used to configure TLS. DB values are updated and NOTIFY executed.
* regiond is not yet in the state where it "subscribed" to events with LISTEN command.

Possible workarounds:
1. Ensure that regiond is fully started and retry CLI command
2. Restart MAAS. It will pick up new values on start.

Related branches

Bill Wear (billwear)
Changed in maas:
status: New → Triaged
importance: Undecided → High
Revision history for this message
Bill Wear (billwear) wrote :

*** note to bug council *** @troyanov would like to discuss this with the bug council when they meet.

Changed in maas:
importance: High → Low
tags: added: bug-council
Revision history for this message
Jerzy Husakowski (jhusakowski) wrote :

MAAS likely should first subscribe to DB notifications and then read the DB contents to prevent this race condition.

Changed in maas:
milestone: none → 3.4.0
no longer affects: maas/3.2
tags: removed: bug-council
Alberto Donato (ack)
Changed in maas:
milestone: 3.4.0 → 3.4.x
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.