public inbox for [email protected]help / color / mirror / Atom feed
[pgAdmin4][Patch]: RM 3927 Unable to debug the procedure inside package 5+ messages / 3 participants [nested] [flat]
* [pgAdmin4][Patch]: RM 3927 Unable to debug the procedure inside package @ 2019-01-28 12:32 Akshay Joshi <[email protected]> 2019-01-29 11:18 ` Re: [pgAdmin4][Patch]: RM 3927 Unable to debug the procedure inside package Dave Page <[email protected]> 0 siblings, 1 reply; 5+ messages in thread From: Akshay Joshi @ 2019-01-28 12:32 UTC (permalink / raw) To: pgadmin-hackers Hi Hackers, Attached is the patch to fix RM 3927 "Unable to debug the procedure inside package". Problem with the existing code is we assume that "PLDBGBREAK" will be always found in the first element of the notification list. In this patch we loop through the list and found the string. Apart from that patch contains small fix to cancel the transaction of Query Tool when panel is closed. Please review it. -- *Akshay Joshi* *Sr. Software Architect * *Phone: +91 20-3058-9517Mobile: +91 976-788-8246* Attachments: [application/octet-stream] RM_3927.patch (2.0K, 3-RM_3927.patch) download | inline diff: diff --git a/web/pgadmin/tools/datagrid/__init__.py b/web/pgadmin/tools/datagrid/__init__.py index 709e164..4dfb7e7 100644 --- a/web/pgadmin/tools/datagrid/__init__.py +++ b/web/pgadmin/tools/datagrid/__init__.py @@ -402,6 +402,7 @@ def close(trans_id): # Release the connection if conn.connected(): + # conn.cancel_transaction(cmd_obj.conn_id, cmd_obj.did) manager.release(did=cmd_obj.did, conn_id=cmd_obj.conn_id) # Remove the information of unique transaction id from the diff --git a/web/pgadmin/tools/debugger/__init__.py b/web/pgadmin/tools/debugger/__init__.py index 9e5ff91..c9f1a4e 100644 --- a/web/pgadmin/tools/debugger/__init__.py +++ b/web/pgadmin/tools/debugger/__init__.py @@ -1301,20 +1301,22 @@ def messages(trans_id): # From the above message we need to find out port number # as "7" so below logic will find 7 as port number # and attach listened to that port number - offset = notify[0].find('PLDBGBREAK') - str_len = len('PLDBGBREAK') - str_len += 1 - tmpOffset = 0 - tmpFlag = False + port_found = False + for val in notify: + offset = val.find('PLDBGBREAK') + if offset < 0: + continue - while notify[0][offset + str_len + tmpOffset].isdigit(): - status = 'Success' - tmpFlag = True - port_number = port_number + \ - notify[0][offset + str_len + tmpOffset] - tmpOffset += 1 + offset = offset + len('PLDBGBREAK') + 1 + tmpOffset = 0 + + while val[offset + tmpOffset].isdigit(): + status = 'Success' + port_found = True + port_number = port_number + val[offset + tmpOffset] + tmpOffset += 1 - if not tmpFlag: + if not port_found: status = 'Busy' else: status = 'Busy' ^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: [pgAdmin4][Patch]: RM 3927 Unable to debug the procedure inside package 2019-01-28 12:32 [pgAdmin4][Patch]: RM 3927 Unable to debug the procedure inside package Akshay Joshi <[email protected]> @ 2019-01-29 11:18 ` Dave Page <[email protected]> 2019-01-30 04:47 ` Re: [pgAdmin4][Patch]: RM 3927 Unable to debug the procedure inside package Khushboo Vashi <[email protected]> 0 siblings, 1 reply; 5+ messages in thread From: Dave Page @ 2019-01-29 11:18 UTC (permalink / raw) To: Akshay Joshi <[email protected]>; +Cc: pgadmin-hackers Khushboo, can you review this please? If you're happy with it, Akshay can commit. Thanks. On Mon, Jan 28, 2019 at 12:33 PM Akshay Joshi <[email protected]> wrote: > > Hi Hackers, > > Attached is the patch to fix RM 3927 "Unable to debug the procedure inside package". Problem with the existing code is we assume that "PLDBGBREAK" will be always found in the first element of the notification list. > > In this patch we loop through the list and found the string. Apart from that patch contains small fix to cancel the transaction of Query Tool when panel is closed. > > Please review it. > > -- > Akshay Joshi > Sr. Software Architect > > > Phone: +91 20-3058-9517 > Mobile: +91 976-788-8246 -- Dave Page Blog: http://pgsnake.blogspot.com Twitter: @pgsnake EnterpriseDB UK: http://www.enterprisedb.com The Enterprise PostgreSQL Company ^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: [pgAdmin4][Patch]: RM 3927 Unable to debug the procedure inside package 2019-01-28 12:32 [pgAdmin4][Patch]: RM 3927 Unable to debug the procedure inside package Akshay Joshi <[email protected]> 2019-01-29 11:18 ` Re: [pgAdmin4][Patch]: RM 3927 Unable to debug the procedure inside package Dave Page <[email protected]> @ 2019-01-30 04:47 ` Khushboo Vashi <[email protected]> 2019-01-30 07:35 ` Re: [pgAdmin4][Patch]: RM 3927 Unable to debug the procedure inside package Akshay Joshi <[email protected]> 0 siblings, 1 reply; 5+ messages in thread From: Khushboo Vashi @ 2019-01-30 04:47 UTC (permalink / raw) To: Akshay Joshi <[email protected]>; +Cc: pgadmin-hackers Hi Akshay, The issue has been fixed with this patch but I feel we need code refactoring of the existing code especially the loop in which we find the required string. What's your thought? Also, please remove the datagrid/__init__.py file from the patch which I assume you have sent by mistake. Thanks, Khushboo On Tue, Jan 29, 2019 at 4:49 PM Dave Page <[email protected]> wrote: > Khushboo, can you review this please? If you're happy with it, Akshay > can commit. > > Thanks. > > On Mon, Jan 28, 2019 at 12:33 PM Akshay Joshi > <[email protected]> wrote: > > > > Hi Hackers, > > > > Attached is the patch to fix RM 3927 "Unable to debug the procedure > inside package". Problem with the existing code is we assume that > "PLDBGBREAK" will be always found in the first element of the notification > list. > > > > In this patch we loop through the list and found the string. Apart from > that patch contains small fix to cancel the transaction of Query Tool when > panel is closed. > > > > Please review it. > > > > -- > > Akshay Joshi > > Sr. Software Architect > > > > > > Phone: +91 20-3058-9517 > > Mobile: +91 976-788-8246 > > > > -- > Dave Page > Blog: http://pgsnake.blogspot.com > Twitter: @pgsnake > > EnterpriseDB UK: http://www.enterprisedb.com > The Enterprise PostgreSQL Company > > ^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: [pgAdmin4][Patch]: RM 3927 Unable to debug the procedure inside package 2019-01-28 12:32 [pgAdmin4][Patch]: RM 3927 Unable to debug the procedure inside package Akshay Joshi <[email protected]> 2019-01-29 11:18 ` Re: [pgAdmin4][Patch]: RM 3927 Unable to debug the procedure inside package Dave Page <[email protected]> 2019-01-30 04:47 ` Re: [pgAdmin4][Patch]: RM 3927 Unable to debug the procedure inside package Khushboo Vashi <[email protected]> @ 2019-01-30 07:35 ` Akshay Joshi <[email protected]> 2019-01-30 08:49 ` Re: [pgAdmin4][Patch]: RM 3927 Unable to debug the procedure inside package Khushboo Vashi <[email protected]> 0 siblings, 1 reply; 5+ messages in thread From: Akshay Joshi @ 2019-01-30 07:35 UTC (permalink / raw) To: Khushboo Vashi <[email protected]>; +Cc: pgadmin-hackers Hi Khushboo On Wed, Jan 30, 2019 at 10:17 AM Khushboo Vashi < [email protected]> wrote: > Hi Akshay, > > The issue has been fixed with this patch but I feel we need code > refactoring of the existing code especially the loop in which we find the > required string. > What's your thought? > Attached is the updated patch. Please review it. > > Also, please remove the datagrid/__init__.py file from the patch which I > assume you have sent by mistake. > No that file contains fix to cancel the transaction of Query Tool. By mistake that line is commented out. > > Thanks, > Khushboo > > > On Tue, Jan 29, 2019 at 4:49 PM Dave Page <[email protected]> wrote: > >> Khushboo, can you review this please? If you're happy with it, Akshay >> can commit. >> >> Thanks. >> >> On Mon, Jan 28, 2019 at 12:33 PM Akshay Joshi >> <[email protected]> wrote: >> > >> > Hi Hackers, >> > >> > Attached is the patch to fix RM 3927 "Unable to debug the procedure >> inside package". Problem with the existing code is we assume that >> "PLDBGBREAK" will be always found in the first element of the notification >> list. >> > >> > In this patch we loop through the list and found the string. Apart from >> that patch contains small fix to cancel the transaction of Query Tool when >> panel is closed. >> > >> > Please review it. >> > >> > -- >> > Akshay Joshi >> > Sr. Software Architect >> > >> > >> > Phone: +91 20-3058-9517 >> > Mobile: +91 976-788-8246 >> >> >> >> -- >> Dave Page >> Blog: http://pgsnake.blogspot.com >> Twitter: @pgsnake >> >> EnterpriseDB UK: http://www.enterprisedb.com >> The Enterprise PostgreSQL Company >> >> -- *Akshay Joshi* *Sr. Software Architect * *Phone: +91 20-3058-9517Mobile: +91 976-788-8246* Attachments: [application/octet-stream] RM_3927_v2.patch (2.1K, 3-RM_3927_v2.patch) download | inline diff: diff --git a/web/pgadmin/tools/datagrid/__init__.py b/web/pgadmin/tools/datagrid/__init__.py index ded06de..85ab5da 100644 --- a/web/pgadmin/tools/datagrid/__init__.py +++ b/web/pgadmin/tools/datagrid/__init__.py @@ -409,6 +409,7 @@ def close(trans_id): # Release the connection if conn.connected(): + conn.cancel_transaction(cmd_obj.conn_id, cmd_obj.did) manager.release(did=cmd_obj.did, conn_id=cmd_obj.conn_id) # Remove the information of unique transaction id from the diff --git a/web/pgadmin/tools/debugger/__init__.py b/web/pgadmin/tools/debugger/__init__.py index 9e5ff91..42fa12f 100644 --- a/web/pgadmin/tools/debugger/__init__.py +++ b/web/pgadmin/tools/debugger/__init__.py @@ -13,6 +13,7 @@ MODULE_NAME = 'debugger' import simplejson as json import random +import re from flask import url_for, Response, render_template, request, session, \ current_app @@ -1301,20 +1302,16 @@ def messages(trans_id): # From the above message we need to find out port number # as "7" so below logic will find 7 as port number # and attach listened to that port number - offset = notify[0].find('PLDBGBREAK') - str_len = len('PLDBGBREAK') - str_len += 1 - tmpOffset = 0 - tmpFlag = False - - while notify[0][offset + str_len + tmpOffset].isdigit(): - status = 'Success' - tmpFlag = True - port_number = port_number + \ - notify[0][offset + str_len + tmpOffset] - tmpOffset += 1 - - if not tmpFlag: + port_found = False + tmp_list = list(filter(lambda x: 'PLDBGBREAK' in x, notify)) + if len(tmp_list) > 0: + port_number = re.search(r'\d+', tmp_list[0]) + if port_number is not None: + status = 'Success' + port_number = port_number.group(0) + port_found = True + + if not port_found: status = 'Busy' else: status = 'Busy' ^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: [pgAdmin4][Patch]: RM 3927 Unable to debug the procedure inside package 2019-01-28 12:32 [pgAdmin4][Patch]: RM 3927 Unable to debug the procedure inside package Akshay Joshi <[email protected]> 2019-01-29 11:18 ` Re: [pgAdmin4][Patch]: RM 3927 Unable to debug the procedure inside package Dave Page <[email protected]> 2019-01-30 04:47 ` Re: [pgAdmin4][Patch]: RM 3927 Unable to debug the procedure inside package Khushboo Vashi <[email protected]> 2019-01-30 07:35 ` Re: [pgAdmin4][Patch]: RM 3927 Unable to debug the procedure inside package Akshay Joshi <[email protected]> @ 2019-01-30 08:49 ` Khushboo Vashi <[email protected]> 0 siblings, 0 replies; 5+ messages in thread From: Khushboo Vashi @ 2019-01-30 08:49 UTC (permalink / raw) To: Akshay Joshi <[email protected]>; +Cc: pgadmin-hackers The patch looks good to me. On Wed, Jan 30, 2019 at 1:05 PM Akshay Joshi <[email protected]> wrote: > Hi Khushboo > > On Wed, Jan 30, 2019 at 10:17 AM Khushboo Vashi < > [email protected]> wrote: > >> Hi Akshay, >> >> The issue has been fixed with this patch but I feel we need code >> refactoring of the existing code especially the loop in which we find the >> required string. >> What's your thought? >> > > Attached is the updated patch. Please review it. > >> >> Also, please remove the datagrid/__init__.py file from the patch which I >> assume you have sent by mistake. >> > > No that file contains fix to cancel the transaction of Query Tool. By > mistake that line is commented out. > >> >> Thanks, >> Khushboo >> >> >> On Tue, Jan 29, 2019 at 4:49 PM Dave Page <[email protected]> wrote: >> >>> Khushboo, can you review this please? If you're happy with it, Akshay >>> can commit. >>> >>> Thanks. >>> >>> On Mon, Jan 28, 2019 at 12:33 PM Akshay Joshi >>> <[email protected]> wrote: >>> > >>> > Hi Hackers, >>> > >>> > Attached is the patch to fix RM 3927 "Unable to debug the procedure >>> inside package". Problem with the existing code is we assume that >>> "PLDBGBREAK" will be always found in the first element of the notification >>> list. >>> > >>> > In this patch we loop through the list and found the string. Apart >>> from that patch contains small fix to cancel the transaction of Query Tool >>> when panel is closed. >>> > >>> > Please review it. >>> > >>> > -- >>> > Akshay Joshi >>> > Sr. Software Architect >>> > >>> > >>> > Phone: +91 20-3058-9517 >>> > Mobile: +91 976-788-8246 >>> >>> >>> >>> -- >>> Dave Page >>> Blog: http://pgsnake.blogspot.com >>> Twitter: @pgsnake >>> >>> EnterpriseDB UK: http://www.enterprisedb.com >>> The Enterprise PostgreSQL Company >>> >>> > > -- > *Akshay Joshi* > > *Sr. Software Architect * > > > > *Phone: +91 20-3058-9517Mobile: +91 976-788-8246* > ^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2019-01-30 08:49 UTC | newest] Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2019-01-28 12:32 [pgAdmin4][Patch]: RM 3927 Unable to debug the procedure inside package Akshay Joshi <[email protected]> 2019-01-29 11:18 ` Dave Page <[email protected]> 2019-01-30 04:47 ` Khushboo Vashi <[email protected]> 2019-01-30 07:35 ` Akshay Joshi <[email protected]> 2019-01-30 08:49 ` Khushboo Vashi <[email protected]>
This inbox is served by agora; see mirroring instructions for how to clone and mirror all data and code used for this inbox