forked from greenplum-db/diskquota-archive
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
diskquota uses long-lived SPI contexts in most places: at the beginning it calls the SPI_connect function, which creates an SPI context and switches to its use, then it does a lot of work, including SPI_execute, and only at the very end it calls the SPI_finish function, which clears the SPI context. This usage architecture is incorrect and can lead to memory leaks while the SPI context is alive, because the SPI_execute function, for example, allocates memory in it for parsing a SQL query. Correct use of SPI involves opening and closing the SPI as close as possible, so that the SPI context is as short-lived as possible. This patch adds new wrappers for connecting and disconnecting functions from SPI and their usage, and moves the connection to SPI into functions closer to making requests over SPI. Ticket: ADBDEV-6577:
- Loading branch information
Showing
5 changed files
with
125 additions
and
167 deletions.
There are no files selected for viewing
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
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
Oops, something went wrong.