jaydoane commented on a change in pull request #1827: Handle invalid user docid 
in changes_callback
URL: https://github.com/apache/couchdb/pull/1827#discussion_r245164418
 
 

 ##########
 File path: src/chttpd/src/chttpd_auth_cache.erl
 ##########
 @@ -160,9 +160,12 @@ changes_callback({change, {Change}}, _) ->
         <<"_design/", _/binary>> ->
             ok;
         DocId ->
-            UserName = username(DocId),
-            couch_log:debug("Invalidating cached credentials for ~s", 
[UserName]),
-            ets_lru:remove(?CACHE, UserName)
+            try
+                UserName = username(DocId),
+                couch_log:debug("Invalidating cached credentials for ~s", 
[UserName]),
+                ets_lru:remove(?CACHE, UserName)
 
 Review comment:
   Isn't it a problem that we don't remove the doc from the cache if it has an 
invalid name? It seems like it should be removed if it's stale, despite it 
having an unexpected prefix.
   
   Is it possible (or desirable) to prevent such a doc from even entering the 
cache at all?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to