summary |
shortlog | log |
commit |
commitdiff |
tree
first ⋅ prev ⋅ next
ILYA Khlopotov [Wed, 17 Aug 2016 18:45:13 +0000 (11:45 -0700)]
Update handle_config_terminate API
COUCHDB-3102
Alexander Shorin [Sun, 23 Aug 2015 10:25:31 +0000 (13:25 +0300)]
Add LICENSE file
Alexander Shorin [Wed, 4 Feb 2015 15:43:22 +0000 (18:43 +0300)]
Merge remote-tracking branch 'iilyak/2561-make-config-API-consistent'
This closes #1
COUCHDB-2561
ILYA Khlopotov [Fri, 30 Jan 2015 20:10:46 +0000 (12:10 -0800)]
Add vsn to implementaitions of config_listener
COUCHDB-2561
ILYA Khlopotov [Fri, 30 Jan 2015 19:15:08 +0000 (11:15 -0800)]
Don't restart event handler on termiation
COUCHDB-2561
ILYA Khlopotov [Thu, 29 Jan 2015 21:31:24 +0000 (13:31 -0800)]
Update config_listener behaviuor
COUCHDB-2561
Robert Newson [Thu, 20 Nov 2014 09:06:18 +0000 (09:06 +0000)]
fix warning
Robert Newson [Wed, 27 Aug 2014 15:52:17 +0000 (16:52 +0100)]
This dog won't hunt, no sir
Robert Newson [Fri, 22 Nov 2013 16:37:37 +0000 (16:37 +0000)]
set module version to 1
Paul J. Davis [Thu, 8 Aug 2013 12:33:50 +0000 (13:33 +0100)]
Fix monitoring when no parent is provided.
Will squash this down after review.
Paul J. Davis [Thu, 8 Aug 2013 11:15:32 +0000 (12:15 +0100)]
Implement option to provide a parent to monitor
The couch_event_listener_mfa already had the necessary logic for
monitoring the parent process that spawned it for a start_link usage. In
some instances we have rexi_worker process use the enter_loop style APIs
to avoid the need to spawn a separate process. This just adds an option
`{parent, pid()}` that allows these processes to specify the parent to
monitor.
Paul J. Davis [Tue, 18 Jun 2013 17:14:17 +0000 (12:14 -0500)]
Rearrange and lengthen the watchdog delay
I did not completely comprehend that code upgrades are not atomic for
all code. This watchdog ended up causing a node reboot into an unusable
state because it killed couch_db_update_notifier handlers before the new
code was installed for each app.
This lead to mem3 quickly cycling trying to use couch_db_update_notifier
which eventually took down the mem3 app which took down the node. Then
the node would reboot into 1202 after databases had upgraded their
headers which prevented the node from booting correctly.
By extending the timeout to five minutes and placing it before the first
call to terminating couch_db_update I hope to give the release enough
time to complete before telling each handler to upgrade.
Paul J. Davis [Sat, 15 Jun 2013 18:13:05 +0000 (13:13 -0500)]
Kill couch_db_event with supervisor functions
Apparently gen_event ignores unknown kill messages so we'll force a
clean shutdown with superisor functions.
Paul J. Davis [Sat, 15 Jun 2013 16:45:59 +0000 (11:45 -0500)]
Kill couch_db_event when it has installed handlers
This is to force the upgrade switch to the new couch_event application
force update notifications. Theoretically we could accomplish the same
thing with custom appups to forcefully remove couch_db_event from the
supervision tree but it turns out that's really hard.
Paul J. Davis [Fri, 14 Jun 2013 21:24:08 +0000 (16:24 -0500)]
Fix typo in the shutdown sequence
Adam Kocoloski [Fri, 24 May 2013 18:10:49 +0000 (14:10 -0400)]
Fix compilation warning by sending not_registered
Adam Kocoloski [Fri, 24 May 2013 18:09:56 +0000 (14:09 -0400)]
Fix callback spec arity
Paul J. Davis [Sat, 11 May 2013 20:51:42 +0000 (15:51 -0500)]
Use khash for tracking event listeners
After doing some testing locally it became apparent that ets is a bit of
a bottleneck when used as a bag with many duplicate keys. Theoretically
this new approach could be accomplished by nesting ets tables but the
ets table limit makes that approach untenable in the long run.
This just replaces the use of ets with khash as well as runs a nested
hash table structure to store the list of pids for each database name.
Paul J. Davis [Sat, 11 May 2013 20:21:11 +0000 (15:21 -0500)]
Add dependency on khash
Paul J. Davis [Fri, 26 Apr 2013 18:52:12 +0000 (13:52 -0500)]
Minor optimizations for couch_event_registry
Mostly making use of batch operations with match and multiple inserts. I
tried some more aggressive optimizations before these but those only
managed to make things slower. The major thing I tried was to use the
zero timeout trick to collect messages and then batch load those into
ets but that only managed to cause a large number of timeouts.
Paul J. Davis [Fri, 26 Apr 2013 18:50:14 +0000 (13:50 -0500)]
Add a event count metrics
Paul J. Davis [Wed, 24 Apr 2013 19:17:30 +0000 (14:17 -0500)]
Fix use of non-existant APIs
I must've been thinking I was going to add a stop function at some point
in the future. Rather than do that I just used the cast I added
previously.
Paul J. Davis [Wed, 24 Apr 2013 19:17:18 +0000 (14:17 -0500)]
Fix minor syntax errors and typos
Paul J. Davis [Wed, 24 Apr 2013 19:16:28 +0000 (14:16 -0500)]
Minor syntax error
Paul J. Davis [Wed, 24 Apr 2013 19:16:04 +0000 (14:16 -0500)]
Fix export definition for start_link/1
Paul J. Davis [Wed, 24 Apr 2013 19:15:26 +0000 (14:15 -0500)]
Fix use of proplists:get_value/2
It returns undefined when the key isn't found, not false.
Paul J. Davis [Wed, 24 Apr 2013 19:12:16 +0000 (14:12 -0500)]
Support db names specified as a list
I was being a bit conservative before in gathering database names to
listen to. This keeps all binaries and converts lists to binaries.
Anything that's not a list or binary throws an error.
Paul J. Davis [Wed, 24 Apr 2013 19:11:11 +0000 (14:11 -0500)]
Avoid use of undocumented functions
I'd copied this pattern from R14B01's gen_server. Apparently newer
Erlang's complain about it. I've updated to the version found in
R15B03-1.
Paul J. Davis [Wed, 24 Apr 2013 19:10:20 +0000 (14:10 -0500)]
Fix proplists:lookup/2 check
Apparently someone was smoking something strong when they designed the
API of the proplists module. lookup/2 returns none when a key isn't
found which does not at all match get_value/2 which returns undefined.
Paul J. Davis [Wed, 24 Apr 2013 19:10:06 +0000 (14:10 -0500)]
Fix the behaviour_info callback
Paul J. Davis [Wed, 24 Apr 2013 19:09:24 +0000 (14:09 -0500)]
Export the listen/4 function
Paul J. Davis [Wed, 24 Apr 2013 17:24:13 +0000 (12:24 -0500)]
Add OS process listeners
We don't use this in dbcore but if we ever merge this back to CouchDB
then we'll want to have this feature.
Paul J. Davis [Wed, 24 Apr 2013 17:23:36 +0000 (12:23 -0500)]
Fix callback module name for couch_event_registry
Paul J. Davis [Wed, 24 Apr 2013 16:33:21 +0000 (11:33 -0500)]
New couch_event:listen/4 API
This function doesn't return but allows a process to become an event
listener. Useful in RPC situations to avoid spawning an extra process
and doubling the message passing.
Paul J. Davis [Tue, 23 Apr 2013 21:37:08 +0000 (16:37 -0500)]
Add an API for the common case
Most of our current event listeners are single functions that don't
carry much state. Rather than force us to write a behavior module for
every one of these cases we can use this link_listener/4,
stop_listener/1 API to handle this common pattern.
Under the covers this just wraps couch_event_listener rather thinly to
give us the single callback export version of listening for events.
Paul J. Davis [Tue, 23 Apr 2013 20:41:44 +0000 (15:41 -0500)]
Make sure and exit with the reason given
Paul J. Davis [Tue, 23 Apr 2013 20:41:27 +0000 (15:41 -0500)]
Fix start/start_link return values
Paul J. Davis [Tue, 23 Apr 2013 20:40:26 +0000 (15:40 -0500)]
Add a cast API for couch_event_listener
Paul J. Davis [Tue, 23 Apr 2013 19:42:24 +0000 (14:42 -0500)]
Abandon the gen_server "inheritance" approach
There's not much benefit since these things aren't currently in the
supervision tree and the code in fabric_db_update_listener makes things
even more difficult for starting gen_servers.
I did contemplate having fabric_db_udpate_listener make use of
gen_server:enter_loop/N but rexi doesn't use proc_lib to start processes
and I don't have the desire to find out how much overhead that would add
to rexi_server.
Paul J. Davis [Tue, 23 Apr 2013 19:41:24 +0000 (14:41 -0500)]
Add an API to register for multiple DbNames
Just a convenience thing for code that may want to listen to more than
one database's update notifications.
Paul J. Davis [Mon, 22 Apr 2013 20:48:06 +0000 (15:48 -0500)]
Minimize message from monitors
I wasn't deduping monitors before. That bugged me enough to add an extra
ets table so that we can dedupe those messages and avoid the extra work
done by couch_event_registry.
Paul J. Davis [Mon, 22 Apr 2013 20:03:47 +0000 (15:03 -0500)]
Initial implementation
There are a few places we could be more efficient in managing the ets
table for event listeners but this simple approach should be able to
give us a rough idea on how fast we can pump messages through this sort
of design.
Paul J. Davis [Mon, 22 Apr 2013 17:44:14 +0000 (12:44 -0500)]
Initial commit