summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-07-14 16:46:32 +0300
committerValery Piashchynski <[email protected]>2021-07-14 16:46:32 +0300
commit4151bbffe7b3ab882de5f7ac29f41c974679f087 (patch)
treec29840fe2b0e530c069f47ec956b606cd8ff6b1d /plugins
parent9d018f259b45be9268ae85e089a07f25de894f41 (diff)
Fix TTL issue, added explanation comments.
The worker after it executed the request, may overwrite the TTL state. This inconsistency leads to the +1 worker in the FIFO channel. In this state, the Push operation was blocked. Add RR_BROADCAST_PATH. Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'plugins')
-rw-r--r--plugins/websockets/plugin.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/plugins/websockets/plugin.go b/plugins/websockets/plugin.go
index ca5f2f59..1115bd10 100644
--- a/plugins/websockets/plugin.go
+++ b/plugins/websockets/plugin.go
@@ -28,6 +28,9 @@ import (
const (
PluginName string = "websockets"
+
+ RrMode string = "RR_MODE"
+ RrBroadcastPath string = "RR_BROADCAST_PATH"
)
type Plugin struct {
@@ -113,7 +116,7 @@ func (p *Plugin) Serve() chan error {
AllocateTimeout: p.cfg.Pool.AllocateTimeout,
DestroyTimeout: p.cfg.Pool.DestroyTimeout,
Supervisor: p.cfg.Pool.Supervisor,
- }, map[string]string{"RR_MODE": "http"})
+ }, map[string]string{RrMode: "http", RrBroadcastPath: p.cfg.Path})
if err != nil {
errCh <- err
}
@@ -176,7 +179,7 @@ func (p *Plugin) Middleware(next http.Handler) http.Handler {
val, err := p.accessValidator(r)
p.RUnlock()
if err != nil {
- p.log.Error("validation error")
+ p.log.Error("access validation")
w.WriteHeader(400)
return
}
@@ -280,7 +283,7 @@ func (p *Plugin) Reset() error {
AllocateTimeout: p.cfg.Pool.AllocateTimeout,
DestroyTimeout: p.cfg.Pool.DestroyTimeout,
Supervisor: p.cfg.Pool.Supervisor,
- }, map[string]string{"RR_MODE": "http"})
+ }, map[string]string{RrMode: "http", RrBroadcastPath: p.cfg.Path})
if err != nil {
return errors.E(op, err)
}