Commit 805d7c2
committed
[v3-0-test] Handle trigger calls to get_connection apache#55799
In 2.x sometimes get_connection (which goes to the database) might be called without wrapping in sync_to_async.
This did not fail, though it was not good behavior, since it can block the event loop.
In 3.0, since we now route db calls through an API, triggers that do this fail. The reason is, the code to hit the API wraps the get_connection call with async_to_sync, which is forbidden in the asyncio event loop.
Related: apache#55568
(cherry picked from commit f5b1eb4)1 parent 8a1b512 commit 805d7c2
2 files changed
Lines changed: 28 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| 156 | + | |
156 | 157 | | |
157 | 158 | | |
158 | 159 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
737 | 737 | | |
738 | 738 | | |
739 | 739 | | |
740 | | - | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
741 | 758 | | |
742 | 759 | | |
743 | 760 | | |
| |||
1064 | 1081 | | |
1065 | 1082 | | |
1066 | 1083 | | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
1067 | 1093 | | |
1068 | 1094 | | |
1069 | 1095 | | |
| |||
0 commit comments