From eb2678c6254454bc84016234686abf265f869440 Mon Sep 17 00:00:00 2001 From: Jesse Hallam Date: Mon, 1 Oct 2018 17:18:36 -0400 Subject: [PATCH] clarify avoiding API while holding configurationLock --- server/configuration.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/configuration.go b/server/configuration.go index 5bc900f..cc4c8dd 100644 --- a/server/configuration.go +++ b/server/configuration.go @@ -43,7 +43,8 @@ func (p *Plugin) getConfiguration() *configuration { // setConfiguration replaces the active configuration under lock. // // Do not call setConfiguration while holding the configurationLock, as sync.Mutex is not -// reentrant. +// reentrant. In particular, avoid using the plugin API entirely, as this may in turn trigger a +// hook back into the plugin. If that hook attempts to acquire this lock, a deadlock may occur. func (p *Plugin) setConfiguration(configuration *configuration) { p.configurationLock.Lock() defer p.configurationLock.Unlock()