[jira] [Commented] (DISPATCH-1407) Memory leak on link policy denial
[ https://issues.apache.org/jira/browse/DISPATCH-1407?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16925471#comment-16925471 ] ASF subversion and git services commented on DISPATCH-1407: --- Commit 0ed5d5c5c0f00c92e8ac0d02cac3e462a9ebdfd6 in qpid-dispatch's branch refs/heads/master from Gordon Sim [ https://gitbox.apache.org/repos/asf?p=qpid-dispatch.git;h=0ed5d5c ] DISPATCH-1407: free link when peer closes it if router does not have any conetxt for it > Memory leak on link policy denial > - > > Key: DISPATCH-1407 > URL: https://issues.apache.org/jira/browse/DISPATCH-1407 > Project: Qpid Dispatch > Issue Type: Bug > Components: Policy Engine >Affects Versions: 1.8.0 >Reporter: Chuck Rolke >Assignee: Chuck Rolke >Priority: Major > Attachments: A.conf, default.json > > > A router with a simple policy that denies most addresses starts and uses 10M > bytes of memory. A test client loops 25k times opening a link to a denied > address over a single connection and session. Now the router uses 276 Mbytes. > An example policy is > ``` > [ >["vhost", { > "hostname": "$default", > "allowUnknownUser": true, > "groups" : { >"$default": { > "remoteHosts": "*", > "allowDynamicSource": true, > "allowAnonymousSender": true, > "sources": "$management, examples, q1", > "targets": "$management, examples, q1" >} > } >}] > ] > ``` -- This message was sent by Atlassian Jira (v8.3.2#803003) - To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org
[jira] [Commented] (DISPATCH-1407) Memory leak on link policy denial
[ https://issues.apache.org/jira/browse/DISPATCH-1407?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16925174#comment-16925174 ] Chuck Rolke commented on DISPATCH-1407: --- Router policy also allows controlling clients with a maxSessions limit. This limit is enforced differently and will not produce a memory leak. For sessions the limit is negotiated at the AMQP level. The router has no handlers for denying sessions because it is a protocol violation for the client to exceed that limit. An AmqpDotnetLite client attempting to open 256 sessions when the router limit is 2 will see: ``` Exception Amqp.AmqpException: remote channel 2 is above negotiated channel_max 1. at Amqp.Connection.ThrowIfClosed(String operation) at Amqp.Connection.AddSession(Session session) at Amqp.Session..ctor(Connection connection, Begin begin, OnBegin onBegin) at Amqp.Session..ctor(Connection connection) at Examples.Interop.SessionHammer.Main(String[] args) in /home/chug/Downloads/amq-dotnet-2.5.0-core-sdk/examples/Interop.SessionHammer/Interop.SessionHammer.cs:line 54. ``` > Memory leak on link policy denial > - > > Key: DISPATCH-1407 > URL: https://issues.apache.org/jira/browse/DISPATCH-1407 > Project: Qpid Dispatch > Issue Type: Bug > Components: Policy Engine >Affects Versions: 1.8.0 >Reporter: Chuck Rolke >Assignee: Chuck Rolke >Priority: Major > Attachments: A.conf, default.json > > > A router with a simple policy that denies most addresses starts and uses 10M > bytes of memory. A test client loops 25k times opening a link to a denied > address over a single connection and session. Now the router uses 276 Mbytes. > An example policy is > ``` > [ >["vhost", { > "hostname": "$default", > "allowUnknownUser": true, > "groups" : { >"$default": { > "remoteHosts": "*", > "allowDynamicSource": true, > "allowAnonymousSender": true, > "sources": "$management, examples, q1", > "targets": "$management, examples, q1" >} > } >}] > ] > ``` -- This message was sent by Atlassian Jira (v8.3.2#803003) - To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org
[jira] [Commented] (DISPATCH-1407) Memory leak on link policy denial
[ https://issues.apache.org/jira/browse/DISPATCH-1407?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16924995#comment-16924995 ] Chuck Rolke commented on DISPATCH-1407: --- Thanks Gordon. Indeed that fixes it and in a place that logically fits. Please go ahead an commit this. > Memory leak on link policy denial > - > > Key: DISPATCH-1407 > URL: https://issues.apache.org/jira/browse/DISPATCH-1407 > Project: Qpid Dispatch > Issue Type: Bug > Components: Policy Engine >Affects Versions: 1.8.0 >Reporter: Chuck Rolke >Assignee: Chuck Rolke >Priority: Major > Attachments: A.conf, default.json > > > A router with a simple policy that denies most addresses starts and uses 10M > bytes of memory. A test client loops 25k times opening a link to a denied > address over a single connection and session. Now the router uses 276 Mbytes. > An example policy is > ``` > [ >["vhost", { > "hostname": "$default", > "allowUnknownUser": true, > "groups" : { >"$default": { > "remoteHosts": "*", > "allowDynamicSource": true, > "allowAnonymousSender": true, > "sources": "$management, examples, q1", > "targets": "$management, examples, q1" >} > } >}] > ] > ``` -- This message was sent by Atlassian Jira (v8.3.2#803003) - To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org
[jira] [Commented] (DISPATCH-1407) Memory leak on link policy denial
[ https://issues.apache.org/jira/browse/DISPATCH-1407?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16924677#comment-16924677 ] Gordon Sim commented on DISPATCH-1407: -- When link attach fails on policy, the pn_link_t does not have a corresponding qd_link_t created. This means the link is not freed when the peer responds to the detach. Possible fix: {noformat} diff --git a/src/container.c b/src/container.c index 22a42867..303beab9 100644 --- a/src/container.c +++ b/src/container.c @@ -617,6 +617,8 @@ void qd_container_handle_event(qd_container_t *container, pn_event_t *event, if (node) { node->ntype->link_detach_handler(node->context, qd_link, dt); } +} else { +pn_link_free(pn_link); } } break; {noformat} > Memory leak on link policy denial > - > > Key: DISPATCH-1407 > URL: https://issues.apache.org/jira/browse/DISPATCH-1407 > Project: Qpid Dispatch > Issue Type: Bug > Components: Policy Engine >Affects Versions: 1.8.0 >Reporter: Chuck Rolke >Assignee: Chuck Rolke >Priority: Major > Attachments: A.conf, default.json > > > A router with a simple policy that denies most addresses starts and uses 10M > bytes of memory. A test client loops 25k times opening a link to a denied > address over a single connection and session. Now the router uses 276 Mbytes. > An example policy is > ``` > [ >["vhost", { > "hostname": "$default", > "allowUnknownUser": true, > "groups" : { >"$default": { > "remoteHosts": "*", > "allowDynamicSource": true, > "allowAnonymousSender": true, > "sources": "$management, examples, q1", > "targets": "$management, examples, q1" >} > } >}] > ] > ``` -- This message was sent by Atlassian Jira (v8.3.2#803003) - To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org
[jira] [Commented] (DISPATCH-1407) Memory leak on link policy denial
[ https://issues.apache.org/jira/browse/DISPATCH-1407?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16924651#comment-16924651 ] Chuck Rolke commented on DISPATCH-1407: --- Analysis to date: * Valgrind shows only python-related mallocs; this is inconclusive. Valgrind shows no actionable C-language malloc leaks. * The same problem is present in 1.7.0, 1.6.0, 1.5.0, and 1.4.x * Policy code was modified not to include setting pn_condition to signal the error - still has memory growth * Container code was modified to call pn_condition_clear for local and remote conditions when link is detached - no change * Tried making a policy.c static python module load and not loading only when needed - no change > Memory leak on link policy denial > - > > Key: DISPATCH-1407 > URL: https://issues.apache.org/jira/browse/DISPATCH-1407 > Project: Qpid Dispatch > Issue Type: Bug > Components: Policy Engine >Affects Versions: 1.8.0 >Reporter: Chuck Rolke >Assignee: Chuck Rolke >Priority: Major > Attachments: A.conf, default.json > > > A router with a simple policy that denies most addresses starts and uses 10M > bytes of memory. A test client loops 25k times opening a link to a denied > address over a single connection and session. Now the router uses 276 Mbytes. > An example policy is > ``` > [ >["vhost", { > "hostname": "$default", > "allowUnknownUser": true, > "groups" : { >"$default": { > "remoteHosts": "*", > "allowDynamicSource": true, > "allowAnonymousSender": true, > "sources": "$management, examples, q1", > "targets": "$management, examples, q1" >} > } >}] > ] > ``` -- This message was sent by Atlassian Jira (v8.3.2#803003) - To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org
[jira] [Commented] (DISPATCH-1407) Memory leak on link policy denial
[ https://issues.apache.org/jira/browse/DISPATCH-1407?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16924642#comment-16924642 ] Chuck Rolke commented on DISPATCH-1407: --- With A.conf and default.json in your cwd, run _qdrouterd -c A.conf_ Then open a disallowed source or target. > Memory leak on link policy denial > - > > Key: DISPATCH-1407 > URL: https://issues.apache.org/jira/browse/DISPATCH-1407 > Project: Qpid Dispatch > Issue Type: Bug > Components: Policy Engine >Affects Versions: 1.8.0 >Reporter: Chuck Rolke >Assignee: Chuck Rolke >Priority: Major > Attachments: A.conf, default.json > > > A router with a simple policy that denies most addresses starts and uses 10M > bytes of memory. A test client loops 25k times opening a link to a denied > address over a single connection and session. Now the router uses 276 Mbytes. > An example policy is > ``` > [ >["vhost", { > "hostname": "$default", > "allowUnknownUser": true, > "groups" : { >"$default": { > "remoteHosts": "*", > "allowDynamicSource": true, > "allowAnonymousSender": true, > "sources": "$management, examples, q1", > "targets": "$management, examples, q1" >} > } >}] > ] > ``` -- This message was sent by Atlassian Jira (v8.3.2#803003) - To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org