Enabled heap check (#1306)#1316
Conversation
mattklein123
left a comment
There was a problem hiding this comment.
Sweet. Thanks @mrice32 !
dnoe
left a comment
There was a problem hiding this comment.
Thanks for figuring this out
|
I think we should probably put this in |
|
Oh yeah putting in bazel.rc would be great. Good call. |
ci/build_setup.sh
Outdated
| --jobs=${NUM_CPUS} --show_task_finish" | ||
| export BAZEL_TEST_OPTIONS="${BAZEL_BUILD_OPTIONS} --test_env=HOME --test_env=PYTHONUSERBASE \ | ||
| --test_env=HEAPCHECK --test_env=PPROF_PATH --cache_test_results=no --test_output=all" | ||
| --test_env=HEAPCHECK --test_output=all" |
There was a problem hiding this comment.
I think you were off-by-one in arg position in the cut+paste here..
tools/bazel.rc
Outdated
| build:clang-msan --copt -fsanitize-memory-track-origins=2 | ||
|
|
||
| # Test options | ||
| test --test_env=HEAPCHECK --test_env=PPROF_PATH |
There was a problem hiding this comment.
Should this be --test_env=HEAPCHECK=normal? Is there a way to get the pprof location from the gperftools build in the local situation? Or if it's too complicated, what happens when you specify HEAPCHECK=normal but no PPROF_PATH?
There was a problem hiding this comment.
I think setting HEAPCHECK to normal in the bazel.rc is preferable. I'll do some testing. I think PPROF_PATH defaults to pprof (so it should find it if you have it installed). I'm not sure what happens if pprof doesn't exist. HEAPCHECK should work okay without using pprof anyway. It apparently just makes the heap check better.
There was a problem hiding this comment.
Nothing breaks if pprof isn't installed, and the heap checker still runs. Setting --test_env=HEAPCHECK=normal --test_env=PPROF_PATH should be fine in the bazel.rc. Note: If HEAPCHECK is explicitly set to normal in bazel.rc the user cannot override it by just exporting HEAPCHECK in their local environment. The user will have to explicitly set --test_env=HEAPCHECK (grabbing the env variable) or --test_env=HEAPCHECK=[user_setting] (modifying it in the command directly) to override the normal setting. Whatever we choose, I'll add it into the docs.
There was a problem hiding this comment.
I don't have a strong opinion on which one is chosen as long as we doc it. Will let both of you choose.
|
To be clear, putting this in |
|
Can you add a section to |
Description: in general java String usage accross the JNI layer is precarious. Reverting usage back to ByteBuffer. Risk Level: low Testing: tested with modified dispatcher code in example app that accessed the installed string accessor in MainActivity.kt Signed-off-by: Jose Nino <jnino@lyft.com> Signed-off-by: JP Simard <jp@jpsim.com>
Description: in general java String usage accross the JNI layer is precarious. Reverting usage back to ByteBuffer. Risk Level: low Testing: tested with modified dispatcher code in example app that accessed the installed string accessor in MainActivity.kt Signed-off-by: Jose Nino <jnino@lyft.com> Signed-off-by: JP Simard <jp@jpsim.com>
**Description**
Before, there was no feedback at all unless you turn on `--debug`.
Choosing what to enable is difficult as the EG layer creates known
errors that confuse, and our layer we log too much debug as info.
This buys time by making a simple status message and verifying it in
tests.
.e.g.
```bash
$ out/aigw-darwin-arm64 run --mcp-json '{
"mcpServers": {
"kiwi": {
"type": "http",
"url": "https://mcp.kiwi.com"
}
}
}'
Envoy AI Gateway listening on http://localhost:1975 (admin http://localhost:51333) after 16.8s
```
Note, it most importantly only shows when (significantly later) envoy is
actually ready. If you send requests before this, it will fail. Future
PRs can improve logging.
**Related Issues/PRs (if applicable)**
Fixes #1304
---------
Signed-off-by: Adrian Cole <adrian@tetrate.io>
Fixes #1306. Heap check was disabled because the environment variables that enable it were not accessible to the running tests. This was fixed by explicitly adding those environment variables to the bazel test options. We now see stack traces for leaks like the following (symbol name availability depends on the build mode):