Thanks for the quick response.  I will also await feedback from Carlos 
about this workaround as well.

For the time being, I would suggest setting it explicitly for calls to 
*memcache.Client().cas()* to workaround this known issue and use memcache 
to your advantage.  Know that we are aware of this issue and working 
towards its root cause.  The aforementioned suggestion is the recommended 
workaround.

On Monday, February 13, 2017 at 12:53:57 PM UTC-5, 
[email protected] wrote:
>
> I do use namespaces. Indeed, I tried to set it explicitally as you said 
> and it worked!
>
> So will the issue be resolved? Should I set the namespace explicitally on 
> my code just in case?
>
> Em segunda-feira, 13 de fevereiro de 2017 15:38:25 UTC-2, Nicholas (Google 
> Cloud Support) escreveu:
>>
>> I appreciate the extra troubleshooting. We've noticed an internal issue 
>> with memcache that may be related but require additional information to 
>> confirm.
>>
>> Are you using namespaces?  If so, can you try setting the namespace in 
>> each method call explicitly?
>>
>> from google.appengine.api import memcache
>> ns = "simple-namespace"
>> memclient = memcache.Client()
>> memclient.add("key", "A", namespace=ns)
>> val = memclient.get("key", for_case=True, namespace=ns)
>> result = memclient.cas("key", "B", namespace=ns)
>> print result
>>
>> The purpose is to test the above instead of using:
>> from google.appengine.api import namespace_manager
>> namespace_manager.set_namespace(ns)
>>
>> I look forward to your feedback while I attempt a few more tests of my 
>> own.
>>
>> On Sunday, February 12, 2017 at 12:16:37 PM UTC-5, Carlos wrote:
>>>
>>> For what it's worth, I have an application where the "client.cas(key, 
>>> counter+1)" which has worked for years, and it practically a direct copy of 
>>> Guido's code on the page below, is suddenly failing in the past few days.  
>>>
>>> http://neopythonic.blogspot.com/2011/08/compare-and-set-in-memcache.html
>>>
>>> I've debugged the code extensively.  It isn't that complex.  But 
>>> something certainly changed on App Engine.
>>> I've tried variations of setting the initial value.
>>> I've tried cas_reset().
>>> I've tried flushing the cache just before the request.
>>> "client.cas(key, counter+1)" is simply returning False every time during 
>>> the while True loop, eventually timing out after 30 seconds.
>>>
>>>
>>> On Friday, February 10, 2017 at 1:43:22 PM UTC-6, Nicholas (Google Cloud 
>>> Support) wrote:
>>>>
>>>> Hey adriano_brasileiro,
>>>>
>>>> I was not able to reproduce the results you describe.  This might 
>>>> require additional investigation which is better suited to the App Engine 
>>>> public issue tracker.  I recommend that you file an issue there and 
>>>> posting 
>>>> a link to that issue here so that others may follow.
>>>>
>>>> When doing so, please include the following:
>>>>
>>>>    - Timestamps for when you first and last noticed this issue 
>>>>    occurring
>>>>    - Does it happen only when reaching a certain load?
>>>>    - Are there any other modules contending with this memcache?
>>>>
>>>> Also, I'd suggest using the *memcache.Client().add()* rather than the 
>>>> static *memcache.add()*.  Lastly, the code you provide suggests that 
>>>> *memcache.Client().get()* returns a dict but it in fact returns the 
>>>> value of a key 
>>>> <https://cloud.google.com/appengine/docs/python/refdocs/google.appengine.api.memcache#google.appengine.api.memcache.Client.get>
>>>>  
>>>> or *None*.
>>>>
>>>> I look forward to seeing you issue report.
>>>>
>>>> On Thursday, February 9, 2017 at 11:45:16 AM UTC-5, 
>>>> [email protected] wrote:
>>>>>
>>>>> I have an application in which I use the memcache to avoid race 
>>>>> conditions by retrieving keys using get(..., for_cas=True) and saving 
>>>>> using 
>>>>> cas. However, ever since yesterday 18:00 (GMT-02) cas is always returning 
>>>>> False for me. Even a code as simple as this:
>>>>>
>>>>> memcache.add('key', 'A')
>>>>> memclient = memcache.Client()
>>>>> dict = memclient.get('key', for_cas=True)
>>>>> result = memclient.cas('key', 'B')
>>>>>
>>>>> print result
>>>>>
>>>>> always returns False on a clean memcache. I have tried to run this 
>>>>> code in different applications and result is always False. If i change 
>>>>> the 
>>>>> code to use traditional get() and set(), result returns True. I havent 
>>>>> done 
>>>>> a deploy in three days, so the code haven't changed as the problem 
>>>>> started 
>>>>> to appear. Did something change in the sdk?
>>>>>
>>>>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/c39e1bd7-f124-43ab-8d37-55f4f72caae8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • [google-appengine]... adriano_brasileiro
    • [google-appen... 'Nicholas (Google Cloud Support)' via Google App Engine
      • [google-a... Carlos
        • [goog... 'Nicholas (Google Cloud Support)' via Google App Engine
          • [... adriano_brasileiro
            • ... 'Nicholas (Google Cloud Support)' via Google App Engine
              • ... Carlos
                • ... 'Nicholas (Google Cloud Support)' via Google App Engine

Reply via email to