Jira (PUP-10659) Data Type casts cause Puppet Server to retain Compiler instances
Title: Message Title zendesk.jira updated an issue Puppet / PUP-10659 Data Type casts cause Puppet Server to retain Compiler instances Change By: zendesk.jira Zendesk Ticket Count: 1 2 Zendesk Ticket IDs: 40701 ,41223 Add Comment This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.371191.1599234718000.75863.1605026580026%40Atlassian.JIRA.
Jira (PUP-10659) Data Type casts cause Puppet Server to retain Compiler instances
Title: Message Title Claire Cadman updated an issue Puppet / PUP-10659 Data Type casts cause Puppet Server to retain Compiler instances Change By: Claire Cadman Labels: doc_reviewed jira_escalated Add Comment This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.371191.1599234718000.53357.1602508560040%40Atlassian.JIRA.
Jira (PUP-10659) Data Type casts cause Puppet Server to retain Compiler instances
Title: Message Title Gabriel Nagy updated an issue Puppet / PUP-10659 Data Type casts cause Puppet Server to retain Compiler instances Change By: Gabriel Nagy Fix Version/s: PUP 6.19.0 Fix Version/s: PUP 5.5.22 Add Comment This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.371191.1599234718000.37952.1600325460042%40Atlassian.JIRA.
Jira (PUP-10659) Data Type casts cause Puppet Server to retain Compiler instances
Title: Message Title Mihai Buzgau updated an issue Puppet / PUP-10659 Data Type casts cause Puppet Server to retain Compiler instances Change By: Mihai Buzgau Sprint: NW - 2020-09-16 , NW - 2020-09-30 Add Comment This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.371191.1599234718000.37030.1600250220359%40Atlassian.JIRA.
Jira (PUP-10659) Data Type casts cause Puppet Server to retain Compiler instances
Title: Message Title Gabriel Nagy assigned an issue to Gabriel Nagy Puppet / PUP-10659 Data Type casts cause Puppet Server to retain Compiler instances Change By: Gabriel Nagy Assignee: Gabriel Nagy Add Comment This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.371191.1599234718000.33608.1599745680037%40Atlassian.JIRA.
Jira (PUP-10659) Data Type casts cause Puppet Server to retain Compiler instances
Title: Message Title Mihai Buzgau updated an issue Puppet / PUP-10659 Data Type casts cause Puppet Server to retain Compiler instances Change By: Mihai Buzgau Story Points: 3 Add Comment This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.371191.1599234718000.32306.1599640020044%40Atlassian.JIRA.
Jira (PUP-10659) Data Type casts cause Puppet Server to retain Compiler instances
Title: Message Title Mihai Buzgau updated an issue Puppet / PUP-10659 Data Type casts cause Puppet Server to retain Compiler instances Change By: Mihai Buzgau Sprint: NW - 2020-09-16 Add Comment This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.371191.1599234718000.32307.1599640020087%40Atlassian.JIRA.
Jira (PUP-10659) Data Type casts cause Puppet Server to retain Compiler instances
Title: Message Title Mihai Buzgau updated an issue Puppet / PUP-10659 Data Type casts cause Puppet Server to retain Compiler instances Change By: Mihai Buzgau Team: Night's Watch Add Comment This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.371191.1599234718000.32305.1599639960033%40Atlassian.JIRA.
Jira (PUP-10659) Data Type casts cause Puppet Server to retain Compiler instances
Title: Message Title Austin Boyd updated an issue Puppet / PUP-10659 Data Type casts cause Puppet Server to retain Compiler instances Change By: Austin Boyd Zendesk Ticket Count: 1 Zendesk Ticket IDs: 40701 Add Comment This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.371191.1599234718000.32143.1599606180083%40Atlassian.JIRA.
Jira (PUP-10659) Data Type casts cause Puppet Server to retain Compiler instances
Title: Message Title Austin Boyd updated an issue Puppet / PUP-10659 Data Type casts cause Puppet Server to retain Compiler instances Change By: Austin Boyd Labels: jira_escalated Add Comment This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.371191.1599234718000.32142.1599606180038%40Atlassian.JIRA.
Jira (PUP-10659) Data Type casts cause Puppet Server to retain Compiler instances
Title: Message Title Henrik Lindberg commented on PUP-10659 Re: Data Type casts cause Puppet Server to retain Compiler instances Charlie SharpsteenI think you are right. Add Comment This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.371191.1599234718000.31240.1599323400037%40Atlassian.JIRA.
Jira (PUP-10659) Data Type casts cause Puppet Server to retain Compiler instances
Title: Message Title Charlie Sharpsteen commented on PUP-10659 Re: Data Type casts cause Puppet Server to retain Compiler instances Initializing the constructor functions with the current compilers scope seems to echo PUP-6582. This commit in Puppet changed most function initialization to use nil as the closure scope: https://github.com/puppetlabs/puppet/commit/915d934ad06 Unless new() is special in some way, it seems like the same rationale would apply. Add Comment This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.371191.1599234718000.31029.1599246960044%40Atlassian.JIRA.
Jira (PUP-10659) Data Type casts cause Puppet Server to retain Compiler instances
Title: Message Title Charlie Sharpsteen commented on PUP-10659 Re: Data Type casts cause Puppet Server to retain Compiler instances The following re-factor of the new_function_for method appears to solve the leak: def new_function_for_type(t, scope) @new_function_cache ||= {} if ! @new_function_cache.key?(t) @new_function_cache[t] = t.new_function.new(nil, loader) end @new_function_cache[t] end The main functional change is passing nil when creating the constructor function instead of passing scope. It seems like this should be fine as functions will fall back to using the current Compiler's global scope if the value previously populated by scope is referenced: https://github.com/puppetlabs/puppet/blob/6.18.0/lib/puppet/pops/functions/function.rb#L78-L79 Also, having constructor functions created in subsequent compilations be dependent on the scope of the first Compiler ever created seems like it would be bug.
Jira (PUP-10659) Data Type casts cause Puppet Server to retain Compiler instances
Title: Message Title Charlie Sharpsteen commented on PUP-10659 Re: Data Type casts cause Puppet Server to retain Compiler instances The cause of this appears to be two behaviors in the following section of code in lib/puppet/functions/new.rb: def new_function_for_type(t, scope) @new_function_cache ||= Hash.new() {|hsh, key| hsh[key] = key.new_function.new(scope, loader) } @new_function_cache[t] end https://github.com/puppetlabs/puppet/blob/6.18.0/lib/puppet/functions/new.rb This maintains a cache of constructor functions for each datatype: new String, new Integer, etc. The two issues are: The cache is a Hash instance with a lambda function that creates constructor functions as they are requested. This lambda closes over the Compiler scope value passed the first time new() is called, which keeps that scope in memory. The Compiler scope value passed the first time new() is called is further passed into the constructor function when it is created. The function then stores it as a local variable: https://github.com/puppetlabs/puppet/blob/6.18.0/lib/puppet/pops/functions/function.rb#L23 Aside from the memory leak, it seems wrong to be using the scope of the first Compiler that happens to call new() to provide data for subsequent compilations. Add Comment
Jira (PUP-10659) Data Type casts cause Puppet Server to retain Compiler instances
Title: Message Title Charlie Sharpsteen updated an issue Puppet / PUP-10659 Data Type casts cause Puppet Server to retain Compiler instances Change By: Charlie Sharpsteen Summary: Data Type casts case cause Puppet Server to retain Compiler instances Add Comment This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.371191.1599234718000.30782.1599235800027%40Atlassian.JIRA.