Skip to content

Commit 8aa6e9e

Browse files
committed
fix: Agent clippy and FAQ
Signed-off-by: Anthony Whalley <[email protected]>
1 parent 30daae8 commit 8aa6e9e

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

FAQ.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
- [Why is my core dump truncated?](#why-is-my-core-dump-truncated)
66

7+
- [Why is my zip file corrupted?](#why-is-my-zip-file-corrupted)
8+
79
- [Why is my log file exactly half of my configured line count?](#why-is-my-log-file-exactly-half-of-my-configured-line-count)
810

911
- [Can I force an upload?](#can-i-force-an-upload)
@@ -12,6 +14,8 @@
1214

1315
- [How do I use the custom endpoint?](#how-do-i-use-the-custom-endpoint)
1416

17+
- [Why am I getting the wrong container info?](#why-am-i-getting-the-wrong-container-info)
18+
1519
## How should I integrate my own uploader?
1620

1721
The core dump handler is designed to quickly move the cores *"off-box"* to an object storage environment with as much additional runtime information as possible.
@@ -73,6 +77,14 @@ terminationGracePeriodSeconds: 120
7377
```
7478
Also see [Kubernetes best practices: terminating with grace](https://cloud.google.com/blog/products/containers-kubernetes/kubernetes-best-practices-terminating-with-grace)
7579

80+
## Why is my zip file corrupted?
81+
82+
As of v8.7.0 there is now have a timer on the core dump to prevent repeated hanging core dumps taking down the system.
83+
For very large core dumps this means the process can be truncated and the zipfile incomplete.
84+
85+
In v8.8.0 We have added the nocompression option to zip process to improve performance and you can increase the timeout default which is currently set to 10 minutes.
86+
87+
7688
## Why is my log file exactly half of my configured line count?
7789

7890
This appears to be a bug in some kubernetes services.
@@ -134,3 +146,9 @@ extraEnvVars: |
134146
- name: S3_ENDPOINT
135147
value: https://the-endpoint
136148
```
149+
150+
## Why am I getting the wrong container info?
151+
152+
Core dump handler trys to find the container information for the crashing process based on the hostname of the pod. This works fine in most scenarios but when pods are created directly in multiple namespaces or the same Statefulsets are created in the same namespaces.
153+
154+
The current recommendation is to create a unique name in both of those scenarios. [See issue 115](https://github.com/IBM/core-dump-handler/issues/115)

core-dump-agent/src/main.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ async fn main() -> Result<(), anyhow::Error> {
288288
async fn process_file(zip_path: &Path, bucket: &Bucket) {
289289
info!("Uploading: {}", zip_path.display());
290290

291-
let f = File::open(&zip_path).expect("no file found");
291+
let f = File::open(zip_path).expect("no file found");
292292

293293
match f.try_lock(FileLockMode::Shared) {
294294
Ok(_) => { /* If we can lock then we are ok */ }
@@ -305,7 +305,7 @@ async fn process_file(zip_path: &Path, bucket: &Bucket) {
305305
}
306306
}
307307

308-
let metadata = fs::metadata(&zip_path).expect("unable to read metadata");
308+
let metadata = fs::metadata(zip_path).expect("unable to read metadata");
309309
info!("zip size is {}", metadata.len());
310310
let path_str = match zip_path.to_str() {
311311
Some(v) => v,
@@ -496,7 +496,7 @@ fn get_sysctl(name: &str) -> Result<String, anyhow::Error> {
496496
info!("Getting sysctl for {}", name);
497497
let output = Command::new("sysctl")
498498
.env("PATH", get_path())
499-
.args(&["-n", name])
499+
.args(["-n", name])
500500
.output()?;
501501
let lines = String::from_utf8(output.stdout)?;
502502
let line = lines.lines().take(1).next().unwrap_or("");
@@ -522,7 +522,7 @@ fn overwrite_sysctl(name: &str, value: &str) -> Result<(), anyhow::Error> {
522522
let s = format!("{}={}", name, value);
523523
let output = Command::new("sysctl")
524524
.env("PATH", get_path())
525-
.args(&["-w", s.as_str()])
525+
.args(["-w", s.as_str()])
526526
.status()?;
527527
if !output.success() {
528528
let e = Error::InvalidOverWrite {

0 commit comments

Comments
 (0)