Re: PATCH: pgagent connection string parsing

From: Ashesh Vashi <ashesh(dot)vashi(at)enterprisedb(dot)com>
To: Dave Page <dpage(at)pgadmin(dot)org>
Cc: neel patel <neel(dot)patel(at)enterprisedb(dot)com>, Thomas Krennwallner <tk+pgsql(at)postsubmeta(dot)net>, pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: PATCH: pgagent connection string parsing
Date: 2018-07-05 04:48:51
Message-ID: CAG7mmoxuE8hB0g3-G-5++YyHkz0DkB+14J1g-715-N6zCN4r7w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

On Wed, May 16, 2018 at 7:31 PM, Ashesh Vashi <ashesh(dot)vashi(at)enterprisedb(dot)com
> wrote:

> [Adding pgadmin-hackers list...]
>
> Hi Team,
>
> Using the mutex around the logging code too to avoid overlapping log
> message.
> Please review it, and let me know your concern.
>
> Implementation details:
> - Moved 'MutexLogger' class, which was used by the connection management
> code only, in the include/misc.h
> - Use a static mutex for the non-windows system, and used 'MutexLogger'
> instance for the better lock/unlock mechanism in the LogMessage(...)
> function.
>
Hi Team,

Please review this patch.

-- Thanks, Ashesh

>
> -- Thanks, Ashesh
>
>
> On Wed, May 16, 2018 at 6:59 PM, Dave Page <dpage(at)pgadmin(dot)org> wrote:
>
>>
>>
>> On Wed, May 16, 2018 at 2:27 PM, Ashesh Vashi <
>> ashesh(dot)vashi(at)enterprisedb(dot)com> wrote:
>>
>>> On Tue, May 8, 2018 at 3:01 PM, Thomas Krennwallner <
>>> tk+pgsql(at)postsubmeta(dot)net> wrote:
>>>
>>>> Hi,
>>>>
>>>> I've just found this suspicious log messages (I've added line numbers in
>>>> the attachment pgagent.log):
>>>>
>>>> 8 Tue May 8 11:11:23 2018 DEBUG: Creating DB connection:
>>>> service=xiserver56_tisdbadm cTue May o8nne ct_timeout11:=151: 23 201
>>>> 8applica DEBtUion_nameG: S=pglaeegpeinngt(dot)(at)(dot)d(dot)e
>>>> 9 v_tisdevel dbname=dev_tisdevel
>>>>
>>>> Note how line 8 and 9 are actually two log messages, which should
>>>> have been printed in two lines:
>>>>
>>>> Tue May 8 11:11:23 2018 DEBUG: Creating DB connection:
>>>> service=xiserver56_tisdbadm connect_timeout=5
>>>> application_name=pgagent(at)dev_tisdevel dbname=dev_tisdevel
>>>> Tue May 8 11:11:23 2018 DEBUG: Sleeping...
>>>>
>>>> It appears that two threads are writing to stdout at the same time,
>>>> which calls for an exclusive lock in function
>>>> void LogMessage(const std::wstring &msg, const int &level)
>>>>
>>> Dave,
>>>
>>> Shall we use a mutex here too?
>>>
>>>
>> I would think so, yes.
>>
>> --
>> Dave Page
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>>
>> EnterpriseDB UK: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>
>

In response to

Browse pgadmin-hackers by date

  From Date Subject
Next Message Dave Page 2018-07-05 08:13:52 pgAdmin 4 commit: Correct the runtime options list.
Previous Message Aditya Toshniwal 2018-07-04 09:19:44 Re: [pgAdmin4][RM3294] User need to reset the layout to see the changed preferences parameters