Re: Fix memleaks and error handling in jsonb_plpython
Вложения
В списке pgsql-hackers по дате отправления:
| От | Michael Paquier |
|---|---|
| Тема | Re: Fix memleaks and error handling in jsonb_plpython |
| Дата | |
| Msg-id | 20190308055911.GG4099@paquier.xyz обсуждение |
| Ответ на | Re: Fix memleaks and error handling in jsonb_plpython (Michael Paquier <michael@paquier.xyz>) |
| Ответы |
Re: Fix memleaks and error handling in jsonb_plpython
|
| Список | pgsql-hackers |
On Wed, Mar 06, 2019 at 11:04:23AM +0900, Michael Paquier wrote: > Another thing is that you cannot just return within a try block with > what is added in PLyObject_FromJsonbContainer, or the error stack is > not reset properly. So they should be replaced by breaks. So, I have been poking at this stuff, and I am finishing with the attached. The origin of the issue comes from PLyObject_ToJsonbValue() and PLyObject_FromJsonbValue() which could result in problems when working on PyObject which it may allocate. So this has resulted in more refactoring of the code than I expected first. I also decided to not keep the additional errors which have been added in the previous version of the patch. From my understanding of the code, these cannot actually happen, so replacing them by assertions is enough in my opinion. While on it, I also noticed that hstore_plpython does not actually need a volatile pointer for plpython_to_hstore(). Also, as all those problems are really unlikely going to happen in real-life cases, improving this code only on HEAD looks enough to me. -- Michael
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера