Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions concourse/scripts/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -279,5 +279,16 @@ run_tpcc() {
echo "pytpcc run"
python3 tpcc.py --config=mongodb.config --no-load --warehouses 2 --clients 10 --duration 600 mongodb &> ./tpcc-run.log
tail -n1000 ./tpcc-run.log
$PREFIX/bin/eloqdoc-cli tpcc --eval "db.dropDatabase()"
popd
}

run_bench_go() {
pushd /home/$current_user/workspace/mongo/tests/gotests/bench_doc
echo "build bench_doc"
go build
echo "run bench_doc"
./bench_doc -eloqdoc-only
$PREFIX/bin/eloqdoc-cli benchmark_db_11 --eval "db.dropDatabase()"
popd
}
Comment on lines +286 to 294
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Add error handling for build and execution failures.

The function lacks error checking after go build and ./bench_doc, which means compilation or runtime failures will be silently ignored and the script will continue. This could lead to false positives in CI.

🔎 Proposed fix to add error handling
 run_bench_go() {
       pushd /home/$current_user/workspace/mongo/tests/gotests/bench_doc
       echo "build bench_doc"
       go build
+      if [ $? -ne 0 ]; then
+            echo "Error: Failed to build bench_doc"
+            popd
+            exit 1
+      fi
       echo "run bench_doc"
       ./bench_doc -eloqdoc-only
+      if [ $? -ne 0 ]; then
+            echo "Error: bench_doc execution failed"
+            popd
+            exit 1
+      fi
       $PREFIX/bin/eloqdoc-cli benchmark_db_11 --eval "db.dropDatabase()"
       popd
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
run_bench_go() {
pushd /home/$current_user/workspace/mongo/tests/gotests/bench_doc
echo "build bench_doc"
go build
echo "run bench_doc"
./bench_doc -eloqdoc-only
$PREFIX/bin/eloqdoc-cli benchmark_db_11 --eval "db.dropDatabase()"
popd
}
run_bench_go() {
pushd /home/$current_user/workspace/mongo/tests/gotests/bench_doc
echo "build bench_doc"
go build
if [ $? -ne 0 ]; then
echo "Error: Failed to build bench_doc"
popd
exit 1
fi
echo "run bench_doc"
./bench_doc -eloqdoc-only
if [ $? -ne 0 ]; then
echo "Error: bench_doc execution failed"
popd
exit 1
fi
$PREFIX/bin/eloqdoc-cli benchmark_db_11 --eval "db.dropDatabase()"
popd
}
🤖 Prompt for AI Agents
concourse/scripts/common.sh lines 286-294: the run_bench_go function currently
runs `go build` and `./bench_doc` without checking for failures; update it to
check the exit status after `go build` and after running `./bench_doc` (or test
executable existence) and exit non‑zero with a clear error message if either
fails (for example: if go build fails echo "bench_doc build failed" and exit 1;
if the binary is missing or `./bench_doc` returns non‑zero echo "bench_doc
execution failed" and exit 1), keeping the existing cleanup/popd behavior.

15 changes: 11 additions & 4 deletions concourse/scripts/main.bash
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,19 @@ DATA_DIR="/home/eloq/workspace/mongo/install/data"

compile_and_install
cleanup_all "$DATA_DIR" "$BUCKET_NAME" "$BUCKET_PREFIX"

launch_eloqdoc "$BUCKET_NAME" "$BUCKET_PREFIX"
try_connect
run_jstests
run_tpcc
shutdown_eloqdoc
cleanup_all "$DATA_DIR" "$BUCKET_NAME" "$BUCKET_PREFIX"

launch_eloqdoc "$BUCKET_NAME" "$BUCKET_PREFIX"
try_connect
run_tpcc
cleanup_all "$DATA_DIR" "$BUCKET_NAME" "$BUCKET_PREFIX"
run_bench_go
shutdown_eloqdoc

launch_eloqdoc "$BUCKET_NAME" "$BUCKET_PREFIX"
try_connect
run_jstests
shutdown_eloqdoc
cleanup_all "$DATA_DIR" "$BUCKET_NAME" "$BUCKET_PREFIX"
15 changes: 11 additions & 4 deletions concourse/scripts/main.ent.bash
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,19 @@ DATA_DIR="/home/eloq/workspace/mongo/install/data"

compile_and_install_ent
cleanup_all "$DATA_DIR" "$BUCKET_NAME" "$BUCKET_PREFIX"

launch_eloqdoc "$BUCKET_NAME" "$BUCKET_PREFIX"
try_connect
run_jstests
run_tpcc
shutdown_eloqdoc
cleanup_all "$DATA_DIR" "$BUCKET_NAME" "$BUCKET_PREFIX"

launch_eloqdoc "$BUCKET_NAME" "$BUCKET_PREFIX"
try_connect
run_tpcc
cleanup_all "$DATA_DIR" "$BUCKET_NAME" "$BUCKET_PREFIX"
run_bench_go
shutdown_eloqdoc

launch_eloqdoc "$BUCKET_NAME" "$BUCKET_PREFIX"
try_connect
run_jstests
shutdown_eloqdoc
cleanup_all "$DATA_DIR" "$BUCKET_NAME" "$BUCKET_PREFIX"
21 changes: 21 additions & 0 deletions tests/gotests/bench_doc/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module eloqdata.com/eloqdoc/bench_doc

go 1.22.2

require (
github.com/google/uuid v1.6.0
go.mongodb.org/mongo-driver v1.17.6
)

require (
github.com/golang/snappy v0.0.4 // indirect
github.com/klauspost/compress v1.16.7 // indirect
github.com/montanaflynn/stats v0.7.1 // indirect
github.com/xdg-go/pbkdf2 v1.0.0 // indirect
github.com/xdg-go/scram v1.1.2 // indirect
github.com/xdg-go/stringprep v1.0.4 // indirect
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect
golang.org/x/crypto v0.26.0 // indirect
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Update golang.org/x/crypto to address security vulnerabilities.

golang.org/x/crypto v0.26.0 is affected by CVE-2024-45337, which allows authorization bypass through misuse of ServerConfig.PublicKeyCallback. Additionally, CVE-2025-22869 introduces a denial of service vulnerability via slow or incomplete key exchanges, and multiple other vulnerabilities have been disclosed in 2025. Upgrade to v0.35.0 or later to address these issues.

🤖 Prompt for AI Agents
In tests/gotests/bench_doc/go.mod around line 18, the dependency
golang.org/x/crypto is pinned to v0.26.0 which is vulnerable (CVE-2024-45337,
CVE-2025-22869, etc.); update the module requirement to golang.org/x/crypto
v0.35.0 or later in go.mod, then run go get golang.org/x/crypto@v0.35.0 (or the
latest safe version) and go mod tidy to update go.sum and vendor files as needed
to ensure the project builds with the patched library.

golang.org/x/sync v0.8.0 // indirect
golang.org/x/text v0.17.0 // indirect
)
52 changes: 52 additions & 0 deletions tests/gotests/bench_doc/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I=
github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
github.com/montanaflynn/stats v0.7.1 h1:etflOAAHORrCC44V+aR6Ftzort912ZU+YLiSTuV8eaE=
github.com/montanaflynn/stats v0.7.1/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow=
github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c=
github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI=
github.com/xdg-go/scram v1.1.2 h1:FHX5I5B4i4hKRVRBCFRxq1iQRej7WO3hhBuJf+UUySY=
github.com/xdg-go/scram v1.1.2/go.mod h1:RT/sEzTbU5y00aCK8UOx6R7YryM0iF1N2MOmC3kKLN4=
github.com/xdg-go/stringprep v1.0.4 h1:XLI/Ng3O1Atzq0oBs3TWm+5ZVgkq2aqdlvP9JtoZ6c8=
github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gijq1dTyGkM=
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 h1:ilQV1hzziu+LLM3zUTJ0trRztfwgjqKnBWNtSRkbmwM=
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78/go.mod h1:aL8wCCfTfSfmXjznFBSZNN13rSJjlIOI1fUNAtF7rmI=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
go.mongodb.org/mongo-driver v1.17.6 h1:87JUG1wZfWsr6rIz3ZmpH90rL5tea7O3IHuSwHUpsss=
go.mongodb.org/mongo-driver v1.17.6/go.mod h1:Hy04i7O2kC4RS06ZrhPRqj/u4DTYkFDAAccj+rVKqgQ=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw=
golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc=
golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
Loading