puppetlabs-stdlib icon indicating copy to clipboard operation
puppetlabs-stdlib copied to clipboard

facter: do not use dummy package instantiation on windows

Open rismoney opened this issue 1 year ago • 9 comments

rismoney avatar Oct 04 '22 18:10 rismoney

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Oct 04 '22 18:10 CLAassistant

can you explain why you propose this change?

bastelfreak avatar Oct 04 '22 18:10 bastelfreak

I believe (still reviewing) that this dummy package instantiation is causing excessive delays when run over a winrm connection. The answer is always 'windows' as I don't believe you can change the package provider on windows before facter runs. Here is what I see using facter -p --timing: fact 'package_provider', took: (16.278307) seconds when every other fact is sub-second.

rismoney avatar Oct 04 '22 18:10 rismoney

not sure if I put this in the right spot. https://tickets.puppetlabs.com/browse/PUP-11647?filter=-2

rismoney avatar Oct 04 '22 18:10 rismoney

maybe it is worth investigating why ot takes so long (if that is always the cas). I know that many people use chololatey on windows, but I am not sure if people set that as default provider.

bastelfreak avatar Oct 04 '22 18:10 bastelfreak

you can't set the default provider to chocolatey before puppet runs. If you set Package {provider=chocolatey} that occurs after facter. so I am not sure what this fact accomplishes on windows. Personally i think the fact is a bit 'dumb', as it only confirms what puppet already knew.

rismoney avatar Oct 04 '22 19:10 rismoney

that is not completly true. A custom provider, like the chocolety one, could overwrite the default provider that puppet core sets. and the initial purpose of this was to figure out which provider will be used, and not what the usual default provider for the platform is.

bastelfreak avatar Oct 04 '22 19:10 bastelfreak

custom provider, like the chocolety one, could overwrite the default provider that puppet core sets.

Can you substantiate that? If that is the case, I will abandon this effort.

rismoney avatar Oct 04 '22 20:10 rismoney

Hi @rismoney - as you have noted, a custom provider cannot override the default. It can claim to be default and then Puppet will "randomly" choose one and warn you about it.

Unfortunately, there seems to be test failures for this PR - could you look to resolve them and then rebase with the current main so we can proceed? :-)

jordanbreen28 avatar Oct 17 '22 09:10 jordanbreen28

Hi @rismoney, As there has been no movement on this PR since October 4th, I will proceed to close this request. Once you have the bandwidth to pick this back up again, and review the comments above, please do re-open this request and we can think about proceeding! Thanks for your continued hard work on this!

jordanbreen28 avatar Nov 14 '22 10:11 jordanbreen28