You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2017/04/18 19:44:41 UTC

[jira] [Commented] (COUCHDB-3379) Fix couch_auth_cache reinitialization logic

    [ https://issues.apache.org/jira/browse/COUCHDB-3379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15973363#comment-15973363 ] 

ASF subversion and git services commented on COUCHDB-3379:
----------------------------------------------------------

Commit d754c8c7f7d43e6d526f800d329704e906f793f0 in couchdb's branch refs/heads/master from [~paul.joseph.davis]
[ https://gitbox.apache.org/repos/asf?p=couchdb.git;h=d754c8c ]

Fix couch_auth_cache reinitialization logic

The couch_auth_cache process was attempting to track its various
monitors and then based on its monitor history decide if a 'DOWN'
message meant it should reinitialize or exit. With the new pluggable
storage engine work there was a subtle change to monitors which ended up
causing couch_auth_cache to receive a monitor from the file descriptor
before it received the monitor from the database's main pid. This
reordering was enough for couch_auth_cache to exit which ended up
causing errors in the test suite with race conditions when the test
tried to open an auth db before couch_auth_cache had restarted and
created the database.

However, if we step back and think harder, we'll never get a monitor
message we didn't ask for so rather than attempt to track specific
monitors we just reinitialize the cache everytime we see a 'DOWN'
message. On the downside this means that we're clearing the cache
multiple times per database exit, however normal operations won't have
this issue since that database never changes and clearing the cache
twice in the test suite is a non issue.

COUCHDB-3379


> Fix couch_auth_cache reinitialization logic
> -------------------------------------------
>
>                 Key: COUCHDB-3379
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-3379
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Database Core
>            Reporter: Paul Joseph Davis
>
> The reinitialization logic is subtle and quite silly in hindsight. This reacted badly with the PSE work that has a slight change to the order of signals (which nothing should be relying on in an async system :). This simplifies and fixes the reinitialization of couch_auth_cache.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)