Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ez3Tp-0004kM-1O for pgadmin-hackers@arkaria.postgresql.org; Thu, 22 Mar 2018 16:54:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ez3Tn-0007Sn-Cz for pgadmin-hackers@arkaria.postgresql.org; Thu, 22 Mar 2018 16:54:19 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ez3Tn-0007Sd-7b for pgadmin-hackers@lists.postgresql.org; Thu, 22 Mar 2018 16:54:19 +0000 Received: from mail-wr0-x22f.google.com ([2a00:1450:400c:c0c::22f]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ez3Tj-0004N2-Jh for pgadmin-hackers@postgresql.org; Thu, 22 Mar 2018 16:54:18 +0000 Received: by mail-wr0-x22f.google.com with SMTP id l49so280644wrl.4 for ; Thu, 22 Mar 2018 09:54:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pgadmin-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=EBbddSYIYvqHemZB/+fYP82TEXEIeAINiR/42oVCiOc=; b=cBSR3zkya0moRA3RIq51a9kbhNVP4mB+A/8TGF/2rGS7aUHj0sm+s3i74Mw4ZybE+y Bh0S75ryLbwSRLLxv2DN0Cm7vHwPx6O0uZFWaVJBZUFwJautWnENdld+Y4n8ldND9KTd OpCpQ9yTItW/NGmHCwv6q5+yelEh8UBxM8MoZSxqdnnAxk3YMNoC6T+07cF6qHvWHq3r K2NickaOLSnCRWf5DJ5YeAjLbObXth4oNLXrvZS5UzyOKm3AgakxLqlbffzHyh5ncbqq qsHlY+gTLirj3dmJUyMVF4F1Q3zK1PkSN0Fce2PmtrLaOWE1Wi8YjtQNSU2E6ppwWUL8 xI4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=EBbddSYIYvqHemZB/+fYP82TEXEIeAINiR/42oVCiOc=; b=eWxc9ack/tk+XSGFrewC42kKgAWYr4ax00+/8fiKLCpyRTrXahOgQNJq8/vZ7vyoIo 0hQ+RjtgX5XKvb7fB1rcn8bH/1YqkupMMn/JDE4qMBkXZ743jRZvAksDm/tmhCICZ5xG XehidWIQ1WT6ej1vd/aVSqQVnoYBKjixLSfmWCzN6iMbrCkjtw+6B95tM5KTy8+cNT6i 347/Sxpzrpp5u7kw8ZKoItdgBs3pGH5pT2nxeq+OlhsL+wQF/NV8N3tfpyt1hk3pBSRb hobfi6e3YRN360MzAZ6bKHKqHeG/B8Q0EbaRAKX5F9VJMchKD2dMO5i2E/wP8TxGtIj8 o3jg== X-Gm-Message-State: AElRT7FNLvsd16Mcr8cYgkdyl6sHeqWK8nWm/wAh4a+Cb7XjGKh7TkS6 FDGITODaCpw4fwvRhGyyYOFh2CKGQomnuNcgKfg5IA== X-Google-Smtp-Source: AG47ELuPZ5EhHZmkSjJjODKxYadITdbOFn2MOzAHettmN9CWb8S7cadVSiKfJ5ZLxqU6uqt1HFHHhVi+hr6LMng50pc= X-Received: by 10.223.196.212 with SMTP id o20mr20014329wrf.144.1521737653138; Thu, 22 Mar 2018 09:54:13 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.69.220 with HTTP; Thu, 22 Mar 2018 09:54:11 -0700 (PDT) In-Reply-To: References: From: Dave Page Date: Thu, 22 Mar 2018 16:54:11 +0000 Message-ID: Subject: Re: v3.0 release on hold To: Akshay Joshi Cc: pgadmin-hackers , Murtuza Zabuawala , Khushboo Vashi , Syed Fahar Abbas , =?UTF-8?B?RGV2cmltIEfDnE5Ew5xa?= Content-Type: multipart/alternative; boundary="f403045f7dbc41cb4705680328b3" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --f403045f7dbc41cb4705680328b3 Content-Type: text/plain; charset="UTF-8" Hi On Thu, Mar 22, 2018 at 1:13 PM, Dave Page wrote: > >>>>> 2) Starting a second instance of the app bundle on Mac doesn't always >>>>> open a new pgAdmin window as it should. It works fine in the debugger, or >>>>> if you start the app with a command like: "/Applications/pgAdmin\ >>>>> 4.app/Contents/MacOS/pgAdmin4". It doesn't work if you double-click >>>>> the appbundle or use a command like "open /Applications/pgAdmin\ 4.app" >>>>> >>>> >>>> Still working on this, not found any solution yet. >>>> >>> >> Not able to figure out the solution yet. I have tried to debug >> the code, but every time it will create a new instance(tray icon). Do I >> need to look into the code or something related to app bundle may be some >> settings in info.plist or any other pointer? >> > > Have a look at the code around line 85 an onwards of pgAdmin4.cpp. It > creates the shared memory interlock (and log/address files) based on the > current username and a hash of the executable name/path. My suspicion is > that the path hash (which is calculated from argv[0] on line 72) is for > some reason getting a different value each time when launched via the > Finder or "open", thus the interlock is failing. > So I took a look at this, and it seems the code is just fine. What is happening is that macOS only allows a single instance of an app to run at once. Whilst that is what we want of course, macOS is causing the new instance to exit before it has a change to open a new pgAdmin window. Using "open -n ..." or calling the embedded executable directly resolves that issue. So, there's another challenge to figure out... :-( -- Dave Page Blog: http://pgsnake.blogspot.com Twitter: @pgsnake EnterpriseDB UK: http://www.enterprisedb.com The Enterprise PostgreSQL Company --f403045f7dbc41cb4705680328b3 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi

On Thu, Mar 22, 2018 at 1:13 PM, Dave Page <dpage@pgadmin.org>= ; wrote:

2) Starting a second instance of the app bundle on Mac doesn't= always open a new pgAdmin window as it should. It works fine in the debugg= er, or if you start the app with a command like: "/Applications/pgAdmi= n\ 4.app/Contents/MacOS/pgAdmin4". It doesn't work if you dou= ble-click the appbundle or use a command like "open /Applications/pgAd= min\ 4.app"

=C2=A0 = Still working on this, not found any solution yet.
<= /blockquote>

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Not able to figure out the solution yet= . I have tried to debug the code, but every time it will create a new insta= nce(tray icon). Do I need to look into the code or something related to app= bundle may be some settings in info.plist or any other pointer?=C2=A0

Have a look at t= he code around line 85 an onwards of pgAdmin4.cpp. It creates the shared me= mory interlock (and log/address files) based on the current username and a = hash of the executable name/path. My suspicion is that the path hash (which= is calculated from argv[0] on line 72) is for some reason getting a differ= ent value each time when launched via the Finder or "open", thus = the interlock is failing.

So I took a look at this, and it seems the code is just fine. What i= s happening is that macOS only allows a single instance of an app to run at= once. Whilst that is what we want of course, macOS is causing the new inst= ance to exit before it has a change to open a new pgAdmin window. Using &qu= ot;open -n ..." or calling the embedded executable directly resolves t= hat issue.

So, there's another challenge to fi= gure out... :-(=C2=A0

--
Dave Page
Blog: http://pgsnake.blogspot.com=
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Ent= erprise PostgreSQL Company
--f403045f7dbc41cb4705680328b3--