[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Libguestfs] [PATCH 3/3] docs: Add a section about what happens to the plugin when nbdkit shuts down.



This was underspecified before.
---
 docs/nbdkit-plugin.pod | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/docs/nbdkit-plugin.pod b/docs/nbdkit-plugin.pod
index ceaef1a..47a46da 100644
--- a/docs/nbdkit-plugin.pod
+++ b/docs/nbdkit-plugin.pod
@@ -240,6 +240,7 @@ This may be called once just before the plugin is unloaded from
 memory.  Note that it's not guaranteed that C<.unload> will always be
 called (eg. the server might be killed or segfault), so you should try
 to make the plugin as robust as possible by not requiring cleanup.
+See also L</SHUTDOWN> below.
 
 =head2 C<.config>
 
@@ -528,6 +529,16 @@ If none of the above thread models are suitable, then use
 C<NBDKIT_THREAD_MODEL_PARALLEL> and implement your own locking using
 C<pthread_mutex_t> etc.
 
+=head1 SHUTDOWN
+
+When nbdkit receives certain signals it will shut down (see
+L<nbdkit(1)/SIGNALS>).  The server will wait for any currently running
+plugin callbacks to finish and also call the C<.unload> callback
+before unloading the plugin.
+
+Note that it's not guaranteed this can always happen (eg. the server
+might be killed by C<SIGKILL> or segfault).
+
 =head1 PARSING SIZE PARAMETERS
 
 Use the C<nbdkit_parse_size> utility function to parse human-readable
-- 
2.13.2


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]