From: Nikhil S. <ni...@st...> - 2013-08-06 04:05:25
|
Me and Andrei looked at the code a bit. Other things look ok in general. Again the use of defines in gtm.h like: #define TopMemoryContext (GetMyThreadInfo->thr_thread_context) make me nervous. This can cause issues in the future as well. As an example, the following code in GTM_ThreadCreate: thrinfo->thr_error_context = AllocSetContextCreate(ErrorContext, The comment above this line says /* * Each thread gets its own ErrorContext and its a child of ErrorContext of * the main process */ However due to the inclusion of gtm.h, ErrorContext becomes a macro and expands to GetMyThreadInfo->thr_error_context which should be NULL! However the code is careful to track and release contexts AFAICS. But we need to be mindful of this in the future as well. Regards, Nikhils On Tue, Aug 6, 2013 at 7:25 AM, Koichi Suzuki <koi...@gm...> wrote: > Okay, the patch looks nice. > > Andrei, did you find any similar (wrong) memory handling? > > Regards; > --- > Koichi Suzuki > > > 2013/8/6 Andrei Martsinchyk <and...@gm...> > >> GTM never pfrees pstrdup'ed value of gti_coordname, and therefore leaks >> memory in the TopMostMemoryContext. >> Please find fix attached. The patch is made against the master branch, >> but applies to STABLE branches, to 1_0 with offsets. >> There were two places where GTM_TransactionInfo was cleaned up, so the >> code was pulled out into a separate function, for easier maintenance. >> >> -- >> Andrei Martsinchyk >> >> StormDB - http://www.stormdb.com >> The Database Cloud >> >> >> >> ------------------------------------------------------------------------------ >> Get your SQL database under version control now! >> Version control is standard for application code, but databases havent >> caught up. So what steps can you take to put your SQL databases under >> version control? Why should you start doing it? Read more to find out. >> >> http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk >> _______________________________________________ >> Postgres-xc-developers mailing list >> Pos...@li... >> https://lists.sourceforge.net/lists/listinfo/postgres-xc-developers >> >> > > > ------------------------------------------------------------------------------ > Get your SQL database under version control now! > Version control is standard for application code, but databases havent > caught up. So what steps can you take to put your SQL databases under > version control? Why should you start doing it? Read more to find out. > http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk > _______________________________________________ > Postgres-xc-developers mailing list > Pos...@li... > https://lists.sourceforge.net/lists/listinfo/postgres-xc-developers > > -- StormDB - http://www.stormdb.com The Database Cloud |