<div dir="ltr"><div dir="ltr"><div>Submit a patch to dogpile.cache to add some related tests cases:</div><div><br></div><div><a href="https://github.com/sqlalchemy/dogpile.cache/pull/145/">https://github.com/sqlalchemy/dogpile.cache/pull/145/</a><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le mar. 26 févr. 2019 à 19:35, Herve Beraud <<a href="mailto:hberaud@redhat.com">hberaud@redhat.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div>FYI dogpile.cache issue was opened:<br></div><div dir="ltr"><a href="https://github.com/sqlalchemy/dogpile.cache/issues/144" target="_blank">https://github.com/sqlalchemy/dogpile.cache/issues/144</a></div><div dir="ltr"><br></div><div>Come with a possible oslo.cache solution that I've introduce there => <a href="https://review.openstack.org/#/c/638788/8" target="_blank">https://review.openstack.org/#/c/638788/8</a><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le mar. 26 févr. 2019 à 16:49, Ben Nemec <<a href="mailto:openstack@nemebean.com" target="_blank">openstack@nemebean.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Copying Mike. More thoughts inline.<br>
<br>
On 2/26/19 9:24 AM, Herve Beraud wrote:<br>
> Hi,<br>
> <br>
> Just a heads up that the latest version of dogpile (0.7.0 onwards)<br>
> have become incompatible with oslo.cache. This is causing a few<br>
> issues for jobs. It's a little complex due to functional code and many <br>
> decorated functions.<br>
> <br>
> The error you will see is:<br>
> /<br>
> /<br>
> <br>
> /oslo_cache.//tests.test_//cache.CacheRegi//onTest.//test_function_//key_generator_//with_kwargs<br>
> -------//-------//-------//-------//-------//-------//-------//-------//-------//-------//-------//------/<br>
> <br>
> //<br>
> <br>
> /Captured traceback:<br>
> ~~~~~~~~~~~~~~~~~~~<br>
> b'Traceback (most recent call last):'<br>
> b' File "/tmp/oslo.//cache/oslo_//cache/tests///test_cache.//py", <br>
> line 324, in test_function_//key_generator_//with_kwargs'<br>
> b' value=self.//test_value)//'<br>
> b' File <br>
> "/tmp/oslo.//cache/.//tox/py37///lib/python3.//7/site-//packages///testtools///testcase.//py", <br>
> line 485, in assertRaises'<br>
> b' self.assertThat//(our_callable, matcher)'<br>
> b' File <br>
> "/tmp/oslo.//cache/.//tox/py37///lib/python3.//7/site-//packages///testtools///testcase.//py", <br>
> line 498, in assertThat'<br>
> b' raise mismatch_error'<br>
> b'testtools//.matchers.//_impl.MismatchE//rror: <function <br>
> CacheRegionTest//._get_cacheable//_function.//<locals>//.cacheable_//function <br>
> at 0x7fec3f795400> returned <br>
> <oslo_cache.//tests.test_//cache.TestProxy//Value object at <br>
> 0x7fec3f792550>'/<br>
> <br>
> <br>
> The problem appear since we uncap dogpile.cache on oslo.cache: <br>
> <a href="https://github.com/openstack/oslo.cache/commit/62b53099861134859482656dc92db81243b88bd9" rel="noreferrer" target="_blank">https://github.com/openstack/oslo.cache/commit/62b53099861134859482656dc92db81243b88bd9</a><br>
> <br>
> The following unit test fail since we uncap dogpile => <br>
> <a href="https://github.com/openstack/oslo.cache/blob/master/oslo_cache/tests/test_cache.py#L318" rel="noreferrer" target="_blank">https://github.com/openstack/oslo.cache/blob/master/oslo_cache/tests/test_cache.py#L318</a><br>
> <br>
> The problem was introduced by: <br>
> <a href="https://gerrit.sqlalchemy.org/#/c/sqlalchemy/dogpile.cache/+/996/" rel="noreferrer" target="_blank">https://gerrit.sqlalchemy.org/#/c/sqlalchemy/dogpile.cache/+/996/</a><br>
> <br>
> Your main issue on oslo.cache side is that keyword arguments are <br>
> tranformed in positionnal arguments when we use <br>
> dogpile.cache.region.cache_on_arguments.<br>
> <br>
> I've try to revert the changes introduced by the previous dogpile.cache <br>
> change and everything works fine on the oslo.cache side when changes was <br>
> reverted (reverted to revision <br>
> <a href="https://github.com/sqlalchemy/dogpile.cache/blob/2762ada1f5e43075494d91c512f7c1ec68907258/dogpile/cache/region.py" rel="noreferrer" target="_blank">https://github.com/sqlalchemy/dogpile.cache/blob/2762ada1f5e43075494d91c512f7c1ec68907258/dogpile/cache/region.py</a>).<br>
> <br>
> The expected behavior is that dogpile.cache.util.function_key_generator <br>
> raise a ValueError if **kwargs founds, but our kwargs is empty and our <br>
> `value=self.test_value was` is recognized as a positionnal argument.<br>
> Our unit test looking for an assertRaise(ValueError) on cachable <br>
> decorated function when we pass kwargs but it doesn't happen due to <br>
> empty kwargs.<br>
> <br>
> For these reasons we guess that is an dogpile.cache issue and not an <br>
> oslo.cache issue due to the changes introduced by `decorator` module.<br>
> <br>
> The following are related:<br>
> <br>
> - <br>
> <a href="https://github.com/openstack/oslo.cache/blob/master/oslo_cache/tests/test_cache.py#L318" rel="noreferrer" target="_blank">https://github.com/openstack/oslo.cache/blob/master/oslo_cache/tests/test_cache.py#L318</a> <br>
> : unit test where the problem occure<br>
> - <a href="https://review.openstack.org/#/c/638788/" rel="noreferrer" target="_blank">https://review.openstack.org/#/c/638788/</a> : possible fix but we don't <br>
> think that is the right way<br>
> - <a href="https://review.openstack.org/#/c/638732/" rel="noreferrer" target="_blank">https://review.openstack.org/#/c/638732/</a> : possible remove of the unit <br>
> test who fail<br>
<br>
As I noted in the reviews, I don't think this is something we should <br>
have been testing in oslo.cache in the first place. The failing test is <br>
testing the dogpile interface, not the oslo.cache one. I've seen no <br>
evidence that oslo.cache is doing anything wrong here, so our unit tests <br>
are clearly testing something that should be out of scope.<br>
<br>
And to be clear, I'm not even sure this is a bug in dogpile. It may be a <br>
happy side-effect of the decorator change that the regular decorator now <br>
works for kwargs too. I don't know dogpile well enough to make a <br>
definitive statement on that though. Hence cc'ing Mike. :-)<br>
<br>
> <br>
> The issue is being tracked in:<br>
> <br>
> <a href="https://bugs.launchpad.net/oslo.cache/+bug/1817032" rel="noreferrer" target="_blank">https://bugs.launchpad.net/oslo.cache/+bug/1817032</a><br>
> <br>
> If some dogpile expert can take a look and send feedback on this thread <br>
> you are welcome.<br>
> <br>
> Thanks,<br>
> <br>
> -- <br>
> Hervé Beraud<br>
> Senior Software Engineer<br>
> Red Hat - Openstack Oslo<br>
> irc: hberaud<br>
> -----BEGIN PGP SIGNATURE-----<br>
> <br>
> wsFcBAABCAAQBQJb4AwCCRAHwXRBNkGNegAALSkQAHrotwCiL3VMwDR0vcja10Q+<br>
> Kf31yCutl5bAlS7tOKpPQ9XN4oC0ZSThyNNFVrg8ail0SczHXsC4rOrsPblgGRN+<br>
> RQLoCm2eO1AkB0ubCYLaq0XqSaO+Uk81QxAPkyPCEGT6SRxXr2lhADK0T86kBnMP<br>
> F8RvGolu3EFjlqCVgeOZaR51PqwUlEhZXZuuNKrWZXg/oRiY4811GmnvzmUhgK5G<br>
> 5+f8mUg74hfjDbR2VhjTeaLKp0PhskjOIKY3vqHXofLuaqFDD+WrAy/NgDGvN22g<br>
> glGfj472T3xyHnUzM8ILgAGSghfzZF5Skj2qEeci9cB6K3Hm3osj+PbvfsXE/7Kw<br>
> m/xtm+FjnaywZEv54uCmVIzQsRIm1qJscu20Qw6Q0UiPpDFqD7O6tWSRKdX11UTZ<br>
> hwVQTMh9AKQDBEh2W9nnFi9kzSSNu4OQ1dRMcYHWfd9BEkccezxHwUM4Xyov5Fe0<br>
> qnbfzTB1tYkjU78loMWFaLa00ftSxP/DtQ//iYVyfVNfcCwfDszXLOqlkvGmY1/Y<br>
> F1ON0ONekDZkGJsDoS6QdiUSn8RZ2mHArGEWMV00EV5DCIbCXRvywXV43ckx8Z+3<br>
> B8qUJhBqJ8RS2F+vTs3DTaXqcktgJ4UkhYC2c1gImcPRyGrK9VY0sCT+1iA+wp/O<br>
> v6rDpkeNksZ9fFSyoY2o<br>
> =ECSj<br>
> -----END PGP SIGNATURE-----<br>
> <br>
<br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail-m_-2641493646636502152gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>Hervé Beraud</div><div>Senior Software Engineer<br></div><div>Red Hat - Openstack Oslo</div><div>irc: hberaud</div><div>-----BEGIN PGP SIGNATURE-----<br><br>wsFcBAABCAAQBQJb4AwCCRAHwXRBNkGNegAALSkQAHrotwCiL3VMwDR0vcja10Q+<br>Kf31yCutl5bAlS7tOKpPQ9XN4oC0ZSThyNNFVrg8ail0SczHXsC4rOrsPblgGRN+<br>RQLoCm2eO1AkB0ubCYLaq0XqSaO+Uk81QxAPkyPCEGT6SRxXr2lhADK0T86kBnMP<br>F8RvGolu3EFjlqCVgeOZaR51PqwUlEhZXZuuNKrWZXg/oRiY4811GmnvzmUhgK5G<br>5+f8mUg74hfjDbR2VhjTeaLKp0PhskjOIKY3vqHXofLuaqFDD+WrAy/NgDGvN22g<br>glGfj472T3xyHnUzM8ILgAGSghfzZF5Skj2qEeci9cB6K3Hm3osj+PbvfsXE/7Kw<br>m/xtm+FjnaywZEv54uCmVIzQsRIm1qJscu20Qw6Q0UiPpDFqD7O6tWSRKdX11UTZ<br>hwVQTMh9AKQDBEh2W9nnFi9kzSSNu4OQ1dRMcYHWfd9BEkccezxHwUM4Xyov5Fe0<br>qnbfzTB1tYkjU78loMWFaLa00ftSxP/DtQ//iYVyfVNfcCwfDszXLOqlkvGmY1/Y<br>F1ON0ONekDZkGJsDoS6QdiUSn8RZ2mHArGEWMV00EV5DCIbCXRvywXV43ckx8Z+3<br>B8qUJhBqJ8RS2F+vTs3DTaXqcktgJ4UkhYC2c1gImcPRyGrK9VY0sCT+1iA+wp/O<br>v6rDpkeNksZ9fFSyoY2o<br>=ECSj<br>-----END PGP SIGNATURE-----<br><br></div></div></div></div></div></div></div></div></div></div></div></div></div>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>Hervé Beraud</div><div>Senior Software Engineer<br></div><div>Red Hat - Openstack Oslo</div><div>irc: hberaud</div><div>-----BEGIN PGP SIGNATURE-----<br><br>wsFcBAABCAAQBQJb4AwCCRAHwXRBNkGNegAALSkQAHrotwCiL3VMwDR0vcja10Q+<br>Kf31yCutl5bAlS7tOKpPQ9XN4oC0ZSThyNNFVrg8ail0SczHXsC4rOrsPblgGRN+<br>RQLoCm2eO1AkB0ubCYLaq0XqSaO+Uk81QxAPkyPCEGT6SRxXr2lhADK0T86kBnMP<br>F8RvGolu3EFjlqCVgeOZaR51PqwUlEhZXZuuNKrWZXg/oRiY4811GmnvzmUhgK5G<br>5+f8mUg74hfjDbR2VhjTeaLKp0PhskjOIKY3vqHXofLuaqFDD+WrAy/NgDGvN22g<br>glGfj472T3xyHnUzM8ILgAGSghfzZF5Skj2qEeci9cB6K3Hm3osj+PbvfsXE/7Kw<br>m/xtm+FjnaywZEv54uCmVIzQsRIm1qJscu20Qw6Q0UiPpDFqD7O6tWSRKdX11UTZ<br>hwVQTMh9AKQDBEh2W9nnFi9kzSSNu4OQ1dRMcYHWfd9BEkccezxHwUM4Xyov5Fe0<br>qnbfzTB1tYkjU78loMWFaLa00ftSxP/DtQ//iYVyfVNfcCwfDszXLOqlkvGmY1/Y<br>F1ON0ONekDZkGJsDoS6QdiUSn8RZ2mHArGEWMV00EV5DCIbCXRvywXV43ckx8Z+3<br>B8qUJhBqJ8RS2F+vTs3DTaXqcktgJ4UkhYC2c1gImcPRyGrK9VY0sCT+1iA+wp/O<br>v6rDpkeNksZ9fFSyoY2o<br>=ECSj<br>-----END PGP SIGNATURE-----<br><br></div></div></div></div></div></div></div></div></div></div></div></div></div>