Skip to content
This repository has been archived by the owner on Feb 3, 2022. It is now read-only.

Commit

Permalink
[#141]: bug(http): random NPE on RR start
Browse files Browse the repository at this point in the history
  • Loading branch information
rustatian authored Dec 2, 2021
2 parents 3b4b35e + 6610975 commit c33cbd8
Show file tree
Hide file tree
Showing 4 changed files with 109 additions and 27 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
# CHANGELOG

## v2.6.2 (3.12.2021)

## 🩹 Fixes:

- 🐛 Fix: Random NPE on RR start. [BUG](https://github.com/spiral/roadrunner-plugins/issues/143)

---

## v2.6.1 (2.12.2021)

## 🩹 Fixes:

- 🐛 Fix: logger incorrectly escaped HTML, JSON, and other special symbols.

---

## v2.6.0 (30.11.2021)

## 👀 New:
Expand Down
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ require (
github.com/olekukonko/tablewriter v0.0.5
github.com/spf13/cobra v1.2.1
// SPIRAL ------------
github.com/spiral/endure v1.0.9
github.com/spiral/endure v1.0.10
github.com/spiral/errors v1.0.12
github.com/spiral/goridge/v3 v3.2.4
github.com/spiral/roadrunner-plugins/v2 v2.6.1
github.com/spiral/roadrunner-plugins/v2 v2.6.2
github.com/spiral/roadrunner/v2 v2.6.0
// ---------------------
github.com/stretchr/testify v1.7.0
// SPIRAL --------------
github.com/temporalio/roadrunner-temporal v1.0.12
github.com/temporalio/roadrunner-temporal v1.0.13
// ---------------------
github.com/vbauerster/mpb/v5 v5.4.0
)
Expand Down Expand Up @@ -122,7 +122,7 @@ require (
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.7.0 // indirect
go.uber.org/zap v1.19.1 // indirect
golang.org/x/crypto v0.0.0-20211117183948-ae814b36b871 // indirect
golang.org/x/crypto v0.0.0-20211202192323-5770296d904e // indirect
golang.org/x/net v0.0.0-20211201190559-0a0e4e1bb54c // indirect
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
golang.org/x/sys v0.0.0-20211124211545-fe61309f8881 // indirect
Expand All @@ -131,7 +131,7 @@ require (
google.golang.org/genproto v0.0.0-20211129164237-f09f9a12af12 // indirect
google.golang.org/grpc v1.42.0 // indirect
google.golang.org/protobuf v1.27.1 // indirect
gopkg.in/ini.v1 v1.66.0 // indirect
gopkg.in/ini.v1 v1.66.2 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
Expand Down
31 changes: 10 additions & 21 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -67,37 +67,26 @@ github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hC
github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY=
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
github.com/aws/aws-sdk-go-v2 v1.11.1/go.mod h1:SQfA+m2ltnu1cA0soUkj4dRSsmITiVQUJvBIZjzfPyQ=
github.com/aws/aws-sdk-go-v2 v1.11.2 h1:SDiCYqxdIYi6HgQfAWRhgdZrdnOuGyLDJVRSWLeHWvs=
github.com/aws/aws-sdk-go-v2 v1.11.2/go.mod h1:SQfA+m2ltnu1cA0soUkj4dRSsmITiVQUJvBIZjzfPyQ=
github.com/aws/aws-sdk-go-v2/config v1.10.3/go.mod h1:yPMKrwzpPrBny2yk70tIXHCfKnIuPLc+Y9tgY9Ms2NU=
github.com/aws/aws-sdk-go-v2/config v1.11.0 h1:Czlld5zBB61A3/aoegA9/buZulwL9mHHfizh/Oq+Kqs=
github.com/aws/aws-sdk-go-v2/config v1.11.0/go.mod h1:VrQDJGFBM5yZe+IOeenNZ/DWoErdny+k2MHEIpwDsEY=
github.com/aws/aws-sdk-go-v2/credentials v1.6.3/go.mod h1:9YEFqXj6X6lpCCXMmSWWo1jCISkx2lnbLFhAjx+mUWw=
github.com/aws/aws-sdk-go-v2/credentials v1.6.4 h1:2hvbUoHufns0lDIsaK8FVCMukT1WngtZPavN+W2FkSw=
github.com/aws/aws-sdk-go-v2/credentials v1.6.4/go.mod h1:tTrhvBPHyPde4pdIPSba4Nv7RYr4wP9jxXEDa1bKn/8=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.8.1/go.mod h1:MYiG3oeEcmrdBOV7JOIWhionzyRZJWCnByS5FmvhAoU=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.8.2 h1:KiN5TPOLrEjbGCvdTQR4t0U4T87vVwALZ5Bg3jpMqPY=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.8.2/go.mod h1:dF2F6tXEOgmW5X1ZFO/EPtWrcm7XkW07KNcJUGNtt4s=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.1/go.mod h1:22SEiBSQm5AyKEjoPcG1hzpeTI+m9CXfE6yt1h49wBE=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.2 h1:XJLnluKuUxQG255zPNe+04izXl7GSyUVafIsgfv9aw4=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.2/go.mod h1:SgKKNBIoDC/E1ZCDhhMW3yalWjwuLjMcpLzsM/QQnWo=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.0.1/go.mod h1:1xvCD+I5BcDuQUc+psZr7LI1a9pclAWZs3S3Gce5+lg=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.0.2 h1:EauRoYZVNPlidZSZJDscjJBQ22JhVF2+tdteatax2Ak=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.0.2/go.mod h1:xT4XX6w5Sa3dhg50JrYyy3e4WPYo/+WjY/BXtqXVunU=
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.1/go.mod h1:5eEM4wZ6I2GaeOaVXsiJexIH4P1sFnK5Yp2Tlw9Ah3c=
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.2 h1:IQup8Q6lorXeiA/rK72PeToWoWK8h7VAPgHNWdSrtgE=
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.2/go.mod h1:VITe/MdW6EMXPb0o0txu/fsonXbMHUU2OC2Qp7ivU4o=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.5.1/go.mod h1:fEaHB2bi+wVZw4uKMHEXTL9LwtT4EL//DOhTeflqIVo=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.5.2 h1:CKdUNKmuilw/KNmO2Q53Av8u+ZyXMC2M9aX8Z+c/gzg=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.5.2/go.mod h1:FgR1tCsn8C6+Hf+N5qkfrE4IXvUL1RgW87sunJ+5J4I=
github.com/aws/aws-sdk-go-v2/service/sqs v1.13.0/go.mod h1:yKe1+YpZtnwz7h6juYHGg3ZfNMv8qbjexS6sUcPn3yY=
github.com/aws/aws-sdk-go-v2/service/sqs v1.13.1 h1:F2+s4Niqvlvmdzi+wNHvqa9tvgy2VfawUuLhsnLaQbQ=
github.com/aws/aws-sdk-go-v2/service/sqs v1.13.1/go.mod h1:gOsepb5p+dWNJqP37uG78TR3cO0zYlGFLJT9zCCaaX8=
github.com/aws/aws-sdk-go-v2/service/sso v1.6.1/go.mod h1:/73aFBwUl60wKBKhdth2pEOkut5ZNjVHGF9hjXz0bM0=
github.com/aws/aws-sdk-go-v2/service/sso v1.6.2 h1:2IDmvSb86KT44lSg1uU4ONpzgWLOuApRl6Tg54mZ6Dk=
github.com/aws/aws-sdk-go-v2/service/sso v1.6.2/go.mod h1:KnIpszaIdwI33tmc/W/GGXyn22c1USYxA/2KyvoeDY0=
github.com/aws/aws-sdk-go-v2/service/sts v1.11.0/go.mod h1:+BmlPeQ1Y+PuIho93MMKDby12PoUnt1SZXQdEHCzSlw=
github.com/aws/aws-sdk-go-v2/service/sts v1.11.1 h1:QKR7wy5e650q70PFKMfGF9sTo0rZgUevSSJ4wxmyWXk=
github.com/aws/aws-sdk-go-v2/service/sts v1.11.1/go.mod h1:UV2N5HaPfdbDpkgkz4sRzWCvQswZjdO1FfqCWl0t7RA=
github.com/aws/smithy-go v1.9.0 h1:c7FUdEqrQA1/UVKKCNDFQPNKGp4FQg3YW4Ck5SLTG58=
Expand Down Expand Up @@ -515,14 +504,14 @@ github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An
github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns=
github.com/spf13/viper v1.9.0 h1:yR6EXjTp0y0cLN8OZg1CRZmOBdI88UcGkhgyJhu6nZk=
github.com/spf13/viper v1.9.0/go.mod h1:+i6ajR7OX2XaiBkrcZJFK21htRk7eDeLg7+O6bhUPP4=
github.com/spiral/endure v1.0.9 h1:rC9ZubAjESqHMzhgdDkLoRVjQW8QdbVHmarlBNaaUAc=
github.com/spiral/endure v1.0.9/go.mod h1:M2AHi+x+YdQ4gW1rV2aDWGkT6hxJwVWpK4qRiax8Zzw=
github.com/spiral/endure v1.0.10 h1:8WoI4LjlJP7B0qdUDMgB+K7ouir3j8eUzgnSy6iWZ1Q=
github.com/spiral/endure v1.0.10/go.mod h1:M2AHi+x+YdQ4gW1rV2aDWGkT6hxJwVWpK4qRiax8Zzw=
github.com/spiral/errors v1.0.12 h1:38Waf8ZL/Xvxg4HTYGmrUbvi7TCHivmuatNQZlBhQ8s=
github.com/spiral/errors v1.0.12/go.mod h1:j5UReqxZxfkwXkI9mFY87VhEXcXmSg7kAk5Sswy1eEA=
github.com/spiral/goridge/v3 v3.2.4 h1:Octzn0kgpQY10vQhrf0a5RlzCVW1lIEuR6/IGYp0BW4=
github.com/spiral/goridge/v3 v3.2.4/go.mod h1:a6qAtZy+FBaPj/76GweHj6SkgIr+oRVgW5p4e5vLZF4=
github.com/spiral/roadrunner-plugins/v2 v2.6.1 h1:VNbG3RStCOHtxOrZi4bBZGnodCW1Bpa4oRYTAzct6HU=
github.com/spiral/roadrunner-plugins/v2 v2.6.1/go.mod h1:davuiCVhqsDG+6r5GP2stf1hgTkehGLq5jq5mgGaKlA=
github.com/spiral/roadrunner-plugins/v2 v2.6.2 h1:CPSWBhvZjfG7OBQV3UeEUCKwohOhebSTyBi+1RT+WiA=
github.com/spiral/roadrunner-plugins/v2 v2.6.2/go.mod h1:2NuhyNtM7y9KTDlBc2Xy/DJUqTl1lNLar4ubvYEwG10=
github.com/spiral/roadrunner/v2 v2.6.0 h1:LmQ633Aj/+Faseh7vo1YUxmBXat6Dc9ngnl27noVXeA=
github.com/spiral/roadrunner/v2 v2.6.0/go.mod h1:qaqdPLsUdN3K6JWE5PobGm+Kzq9olFrSoy6iX5xA6SQ=
github.com/spiral/sdk-go v1.11.2 h1:oJr9nnY36ZIyz0ITNzjO4Pu1d8XatQSLtLabMz/gtI4=
Expand All @@ -542,8 +531,8 @@ github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5Cc
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s=
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
github.com/temporalio/roadrunner-temporal v1.0.12 h1:7niWN7q0fH/ZDyJiumPL/OgM3mCacC8MB5vOtxCukkg=
github.com/temporalio/roadrunner-temporal v1.0.12/go.mod h1:kph8uaPfw1Z4SHZQHVZY8Sv9T/+NlKGfO+ceoSDDK3s=
github.com/temporalio/roadrunner-temporal v1.0.13 h1:QO/etkluri6SnUUGz1qaPYKxKuxSc1iowT3GY18fh/I=
github.com/temporalio/roadrunner-temporal v1.0.13/go.mod h1:6WqykitsQ2JEu0Yo56sM7wxQ/EVtuwgwd5aVSpPv0zE=
github.com/tklauser/go-sysconf v0.3.9 h1:JeUVdAOWhhxVcU6Eqr/ATFHgXk/mmiItdKeJPev3vTo=
github.com/tklauser/go-sysconf v0.3.9/go.mod h1:11DU/5sG7UexIrp/O6g35hrWzu0JxlwQ3LSFUzyeuhs=
github.com/tklauser/numcpus v0.3.0 h1:ILuRUQBtssgnxw0XXIjKUC56fgnOrFoQQ/4+DeU2biQ=
Expand Down Expand Up @@ -625,8 +614,8 @@ golang.org/x/crypto v0.0.0-20210314154223-e6e6c4f2bb5b/go.mod h1:T9bdIzuCu7OtxOm
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8=
golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20211117183948-ae814b36b871 h1:/pEO3GD/ABYAjuakUS6xSEmmlyVS4kxBNkeA9tLJiTI=
golang.org/x/crypto v0.0.0-20211117183948-ae814b36b871/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.0.0-20211202192323-5770296d904e h1:MUP6MR3rJ7Gk9LEia0LP2ytiH6MuCfs7qYz+47jGdD8=
golang.org/x/crypto v0.0.0-20211202192323-5770296d904e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
Expand Down Expand Up @@ -1054,8 +1043,8 @@ gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMy
gopkg.in/ini.v1 v1.38.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/ini.v1 v1.63.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/ini.v1 v1.66.0 h1:tYFFjdYXTsNBxJhYBABRbTuaKkX6UBzOvbYwhEcaZJQ=
gopkg.in/ini.v1 v1.66.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/ini.v1 v1.66.2 h1:XfR1dOYubytKy4Shzc2LHrrGhU0lDCfDGG1yLPmpgsI=
gopkg.in/ini.v1 v1.66.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8=
gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
Expand Down
85 changes: 84 additions & 1 deletion schemas/config/2.0.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,39 @@
"server": {
"type": "object",
"properties": {
"on_init": {
"description": "Execute command or script before RR starts allocating workers",
"type": "object",
"properties": {
"command": {
"description": "Command to execute. It can be script or binary",
"type": "string",
"examples": [
"php not-worker.php",
"sh script.sh",
"start script.bat"
]
},
"exec_timeout": {
"description": "Script execute timeout",
"$ref": "#/definitions/Duration",
"default": "60s"
},
"env": {
"description": "Environment variables for the worker processes",
"type": "array",
"items": {
"type": "object",
"patternProperties": {
"^[a-zA-Z0-9._-]+$": {
"type": "string"
}
},
"additionalProperties": false
}
}
}
},
"command": {
"description": "Worker starting command, with any required arguments",
"type": "string",
Expand Down Expand Up @@ -153,7 +186,12 @@
"type": "string",
"examples": [
"headers",
"gzip"
"gzip",
"static",
"websockets",
"sendfile",
"new_relic",
"http_metrics"
],
"pattern": "^[0-9a-zA-Z_]+$"
}
Expand Down Expand Up @@ -204,6 +242,18 @@
".exe",
".bat"
]
},
"allow": {
"description": "Allow files with the following extensions to upload",
"type": "array",
"items": {
"type": "string",
"examples": [
".html",
".go"
]
},
"default": ""
}
}
},
Expand Down Expand Up @@ -549,9 +599,42 @@
"additionalProperties": false
}
}
},
"tcp": {
"type": "object",
"description": "Plugin to handle RAW TCP packets, available since RR 2.6.0",
"properties": {
"servers": {
"description": "TCP servers to allocate",
"type": "object",
"$ref": "#/definitions/TCPServers"
}
}
}
},
"definitions": {
"TCPServers": {
"description": "TCP server",
"type": "object",
"properties": {
"addr": {
"description": "Address to listen",
"type": "string",
"pattern": "^tcp:\/\/[0-9a-zA-Z_.-]+:[0-9]{1,5}$"
},
"delimiter": {
"description": "Data packets delimiter. Every send should end either with EOF or with the delimiter",
"type": "string",
"default": "\r\n"
},
"read_buf_size": {
"description": "Chunks that RR uses to read the data. In MB. If you expect big payloads on a TCP server, to reduce `read` syscalls, would be a good practice to use a fairly big enough buffer",
"type": "integer",
"minimum": 1,
"default": 1
}
}
},
"Duration": {
"description": "Time duration",
"anyOf": [
Expand Down

0 comments on commit c33cbd8

Please sign in to comment.