diff options
author | Valery Piashchynski <[email protected]> | 2020-12-17 10:11:56 +0300 |
---|---|---|
committer | GitHub <[email protected]> | 2020-12-17 10:11:56 +0300 |
commit | a1dc59cabb6e63eab232922f4eb5a19dbd168f44 (patch) | |
tree | a35057cd5b8d22002bbd05812a3fb604ce03b705 /plugins/http | |
parent | de3c2274d0009b63ead05ddf3d699012f1d11ada (diff) | |
parent | 1033c25b6bfc752d6059e446510f651e22cbf49b (diff) |
Merge pull request #448 from spiral/plugin/reloader
[RR2] Plugin/reload
Diffstat (limited to 'plugins/http')
-rw-r--r-- | plugins/http/plugin.go | 5 | ||||
-rw-r--r-- | plugins/http/tests/configs/.rr-broken-pipes.yaml | 4 | ||||
-rw-r--r-- | plugins/http/tests/configs/.rr-echoErr.yaml | 4 | ||||
-rw-r--r-- | plugins/http/tests/configs/.rr-env.yaml | 4 | ||||
-rw-r--r-- | plugins/http/tests/configs/.rr-fcgi-reqUri.yaml | 5 | ||||
-rw-r--r-- | plugins/http/tests/configs/.rr-fcgi.yaml | 5 | ||||
-rw-r--r-- | plugins/http/tests/configs/.rr-h2c.yaml | 5 | ||||
-rw-r--r-- | plugins/http/tests/configs/.rr-http.yaml | 3 | ||||
-rw-r--r-- | plugins/http/tests/configs/.rr-init.yaml | 4 | ||||
-rw-r--r-- | plugins/http/tests/configs/.rr-resetter.yaml | 4 | ||||
-rw-r--r-- | plugins/http/tests/configs/.rr-ssl-push.yaml | 4 | ||||
-rw-r--r-- | plugins/http/tests/configs/.rr-ssl-redirect.yaml | 4 | ||||
-rw-r--r-- | plugins/http/tests/configs/.rr-ssl.yaml | 5 | ||||
-rw-r--r-- | plugins/http/tests/http_test.go | 24 |
14 files changed, 56 insertions, 24 deletions
diff --git a/plugins/http/plugin.go b/plugins/http/plugin.go index a6399489..13299da1 100644 --- a/plugins/http/plugin.go +++ b/plugins/http/plugin.go @@ -296,7 +296,7 @@ func (s *Plugin) Reset() error { s.Lock() defer s.Unlock() const op = errors.Op("http reset") - s.log.Info("Resetting http plugin") + s.log.Info("HTTP plugin got restart request. Restarting...") s.pool.Destroy(context.Background()) // re-read the config @@ -317,6 +317,7 @@ func (s *Plugin) Reset() error { return errors.E(op, err) } + s.log.Info("HTTP workers Pool successfully restarted") s.handler, err = NewHandler( s.cfg.MaxRequestSize, *s.cfg.Uploads, @@ -329,7 +330,9 @@ func (s *Plugin) Reset() error { // restore original listeners s.pool.AddListener(s.listener) + s.log.Info("HTTP listeners successfully re-added") + s.log.Info("HTTP plugin successfully restarted") return nil } diff --git a/plugins/http/tests/configs/.rr-broken-pipes.yaml b/plugins/http/tests/configs/.rr-broken-pipes.yaml index aacc303e..e57d0b86 100644 --- a/plugins/http/tests/configs/.rr-broken-pipes.yaml +++ b/plugins/http/tests/configs/.rr-broken-pipes.yaml @@ -24,6 +24,8 @@ http: maxJobs: 0 allocateTimeout: 60s destroyTimeout: 60s - +logs: + mode: development + level: error diff --git a/plugins/http/tests/configs/.rr-echoErr.yaml b/plugins/http/tests/configs/.rr-echoErr.yaml index 6ecdbb2a..24946c88 100644 --- a/plugins/http/tests/configs/.rr-echoErr.yaml +++ b/plugins/http/tests/configs/.rr-echoErr.yaml @@ -24,5 +24,7 @@ http: maxJobs: 0 allocateTimeout: 60s destroyTimeout: 60s - +logs: + mode: development + level: error diff --git a/plugins/http/tests/configs/.rr-env.yaml b/plugins/http/tests/configs/.rr-env.yaml index c9fdc798..e29f66cc 100644 --- a/plugins/http/tests/configs/.rr-env.yaml +++ b/plugins/http/tests/configs/.rr-env.yaml @@ -27,5 +27,7 @@ http: maxJobs: 0 allocateTimeout: 60s destroyTimeout: 60s - +logs: + mode: development + level: error diff --git a/plugins/http/tests/configs/.rr-fcgi-reqUri.yaml b/plugins/http/tests/configs/.rr-fcgi-reqUri.yaml index dbd19445..3009c30e 100644 --- a/plugins/http/tests/configs/.rr-fcgi-reqUri.yaml +++ b/plugins/http/tests/configs/.rr-fcgi-reqUri.yaml @@ -32,4 +32,7 @@ http: http2: enabled: false h2c: false - maxConcurrentStreams: 128
\ No newline at end of file + maxConcurrentStreams: 128 +logs: + mode: development + level: error
\ No newline at end of file diff --git a/plugins/http/tests/configs/.rr-fcgi.yaml b/plugins/http/tests/configs/.rr-fcgi.yaml index 0cbd6d02..45b6dbd0 100644 --- a/plugins/http/tests/configs/.rr-fcgi.yaml +++ b/plugins/http/tests/configs/.rr-fcgi.yaml @@ -32,4 +32,7 @@ http: http2: enabled: false h2c: false - maxConcurrentStreams: 128
\ No newline at end of file + maxConcurrentStreams: 128 +logs: + mode: development + level: error
\ No newline at end of file diff --git a/plugins/http/tests/configs/.rr-h2c.yaml b/plugins/http/tests/configs/.rr-h2c.yaml index d1b24338..cc42e3bf 100644 --- a/plugins/http/tests/configs/.rr-h2c.yaml +++ b/plugins/http/tests/configs/.rr-h2c.yaml @@ -23,4 +23,7 @@ http: http2: enabled: true h2c: true - maxConcurrentStreams: 128
\ No newline at end of file + maxConcurrentStreams: 128 +logs: + mode: development + level: error
\ No newline at end of file diff --git a/plugins/http/tests/configs/.rr-http.yaml b/plugins/http/tests/configs/.rr-http.yaml index 7b91f735..c6868f8c 100644 --- a/plugins/http/tests/configs/.rr-http.yaml +++ b/plugins/http/tests/configs/.rr-http.yaml @@ -37,5 +37,8 @@ http: enabled: false h2c: false maxConcurrentStreams: 128 +logs: + mode: development + level: error diff --git a/plugins/http/tests/configs/.rr-init.yaml b/plugins/http/tests/configs/.rr-init.yaml index 50aa91ec..70b9642b 100644 --- a/plugins/http/tests/configs/.rr-init.yaml +++ b/plugins/http/tests/configs/.rr-init.yaml @@ -37,5 +37,7 @@ http: enabled: false h2c: false maxConcurrentStreams: 128 - +logs: + mode: development + level: error diff --git a/plugins/http/tests/configs/.rr-resetter.yaml b/plugins/http/tests/configs/.rr-resetter.yaml index b46b21f5..f2134812 100644 --- a/plugins/http/tests/configs/.rr-resetter.yaml +++ b/plugins/http/tests/configs/.rr-resetter.yaml @@ -24,5 +24,7 @@ http: maxJobs: 0 allocateTimeout: 60s destroyTimeout: 60s - +logs: + mode: development + level: error diff --git a/plugins/http/tests/configs/.rr-ssl-push.yaml b/plugins/http/tests/configs/.rr-ssl-push.yaml index 02de906a..3aea683c 100644 --- a/plugins/http/tests/configs/.rr-ssl-push.yaml +++ b/plugins/http/tests/configs/.rr-ssl-push.yaml @@ -26,4 +26,6 @@ http: redirect: true cert: fixtures/server.crt key: fixtures/server.key - # rootCa: root.crt
\ No newline at end of file +logs: + mode: development + level: error
\ No newline at end of file diff --git a/plugins/http/tests/configs/.rr-ssl-redirect.yaml b/plugins/http/tests/configs/.rr-ssl-redirect.yaml index 0ba1753e..4d889734 100644 --- a/plugins/http/tests/configs/.rr-ssl-redirect.yaml +++ b/plugins/http/tests/configs/.rr-ssl-redirect.yaml @@ -26,4 +26,6 @@ http: redirect: true cert: fixtures/server.crt key: fixtures/server.key - # rootCa: root.crt
\ No newline at end of file +logs: + mode: development + level: error
\ No newline at end of file diff --git a/plugins/http/tests/configs/.rr-ssl.yaml b/plugins/http/tests/configs/.rr-ssl.yaml index fb54d3fa..83b5a2dc 100644 --- a/plugins/http/tests/configs/.rr-ssl.yaml +++ b/plugins/http/tests/configs/.rr-ssl.yaml @@ -32,4 +32,7 @@ http: http2: enabled: false h2c: false - maxConcurrentStreams: 128
\ No newline at end of file + maxConcurrentStreams: 128 +logs: + mode: development + level: error
\ No newline at end of file diff --git a/plugins/http/tests/http_test.go b/plugins/http/tests/http_test.go index f68cd42c..c8dd4b38 100644 --- a/plugins/http/tests/http_test.go +++ b/plugins/http/tests/http_test.go @@ -41,7 +41,7 @@ var sslClient = &http.Client{ } func TestHTTPInit(t *testing.T) { - cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel)) + cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.ErrorLevel)) assert.NoError(t, err) cfg := &config.Viper{ @@ -104,7 +104,7 @@ func TestHTTPInit(t *testing.T) { } func TestHTTPInformerReset(t *testing.T) { - cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel)) + cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.ErrorLevel)) assert.NoError(t, err) cfg := &config.Viper{ @@ -225,7 +225,7 @@ func informerTest(t *testing.T) { } func TestSSL(t *testing.T) { - cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel)) + cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.ErrorLevel)) assert.NoError(t, err) cfg := &config.Viper{ @@ -353,7 +353,7 @@ func fcgiEcho(t *testing.T) { } func TestSSLRedirect(t *testing.T) { - cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel)) + cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.ErrorLevel)) assert.NoError(t, err) cfg := &config.Viper{ @@ -439,7 +439,7 @@ func sslRedirect(t *testing.T) { } func TestSSLPushPipes(t *testing.T) { - cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel)) + cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.ErrorLevel)) assert.NoError(t, err) cfg := &config.Viper{ @@ -527,7 +527,7 @@ func sslPush(t *testing.T) { } func TestFastCGI_RequestUri(t *testing.T) { - cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel)) + cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.ErrorLevel)) assert.NoError(t, err) cfg := &config.Viper{ @@ -611,7 +611,7 @@ func fcgiReqURI(t *testing.T) { } func TestH2CUpgrade(t *testing.T) { - cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel)) + cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.ErrorLevel)) assert.NoError(t, err) cfg := &config.Viper{ @@ -700,7 +700,7 @@ func h2cUpgrade(t *testing.T) { } func TestH2C(t *testing.T) { - cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel)) + cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.ErrorLevel)) assert.NoError(t, err) cfg := &config.Viper{ @@ -788,7 +788,7 @@ func h2c(t *testing.T) { } func TestHttpMiddleware(t *testing.T) { - cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel)) + cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.ErrorLevel)) assert.NoError(t, err) cfg := &config.Viper{ @@ -887,7 +887,7 @@ func middleware(t *testing.T) { } func TestHttpEchoErr(t *testing.T) { - cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel)) + cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.ErrorLevel)) assert.NoError(t, err) cfg := &config.Viper{ @@ -977,7 +977,7 @@ func echoError(t *testing.T) { } func TestHttpEnvVariables(t *testing.T) { - cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel)) + cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.ErrorLevel)) assert.NoError(t, err) cfg := &config.Viper{ @@ -1061,7 +1061,7 @@ func envVarsTest(t *testing.T) { } func TestHttpBrokenPipes(t *testing.T) { - cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel)) + cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.ErrorLevel)) assert.NoError(t, err) cfg := &config.Viper{ |