Commit fb4c746
authored
[nexus] don't choke on alert globs that don't match anything (#10789)
Currently, the `alert_dispatcher` background task will log a bunch of
errors if any alert receiver exists that has a glob subscription that
does not currently match any existing alert classes. This is because
reprocessing those glob subscriptions attempts to insert an empty `Vec`
of exact subscriptions into the database (because, you know, the glob
doesn't generate any subscriptions), and inserting an empty `Vec` inside
of a `DatastoreCollection::insert_resource` results in an attempt to
execute invalid SQL syntax (see #10788).
Ideally, we'd actually do something about #10788, but since the argument
to `DatastoreCollection::insert_resource` is a wad of arbitrary SQL, I
couldn't immediately think of a way for it to recognize when the query
passed to it is not actually inserting anything. Therefore, I fixed it
the stupid way: by checking if the `Vec` of subscriptions is empty in `
add_exact_subscription_batch_on_conn`, and just returning immediately.
This is somewhat sad to have to do, but at least it fixes #10775.1 parent 892ea87 commit fb4c746
1 file changed
Lines changed: 70 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
696 | 696 | | |
697 | 697 | | |
698 | 698 | | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
699 | 714 | | |
700 | 715 | | |
701 | 716 | | |
| |||
1296 | 1311 | | |
1297 | 1312 | | |
1298 | 1313 | | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
1299 | 1323 | | |
1300 | 1324 | | |
1301 | 1325 | | |
| |||
1493 | 1517 | | |
1494 | 1518 | | |
1495 | 1519 | | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + | |
| 1533 | + | |
| 1534 | + | |
| 1535 | + | |
| 1536 | + | |
| 1537 | + | |
| 1538 | + | |
| 1539 | + | |
| 1540 | + | |
| 1541 | + | |
| 1542 | + | |
| 1543 | + | |
| 1544 | + | |
| 1545 | + | |
| 1546 | + | |
| 1547 | + | |
| 1548 | + | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
| 1552 | + | |
| 1553 | + | |
| 1554 | + | |
| 1555 | + | |
| 1556 | + | |
| 1557 | + | |
| 1558 | + | |
| 1559 | + | |
| 1560 | + | |
| 1561 | + | |
| 1562 | + | |
| 1563 | + | |
| 1564 | + | |
| 1565 | + | |
1496 | 1566 | | |
0 commit comments