You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/vision/status_quo/alan_finds_database_drops_hard.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ If you would like to expand on this story, or adjust the answers to the FAQ, fee
11
11
12
12
Alan has been adding an extension to YouBuy that launches a singleton actor which interacts with a Sqlite database using the `sqlx` crate. The Sqlite database only permits a single active connection at a time, but this is not a problem, because the actor is a singleton, and so there only should be one at a time. He consults the documentation for `sqlx` and comes up with the following code to create a connection and do the query he needs:
13
13
14
-
```rust
14
+
```rust,ignore
15
15
use sqlx::Connection;
16
16
17
17
#[async_std::main]
@@ -41,7 +41,7 @@ Alan tries to figure out what happened from the logs, but the only information h
41
41
42
42
He's a bit confused, because he's accustomed to having things generally be cleaned up automatically when they get dropped (for example, dropping a [`File`](https://doc.rust-lang.org/std/fs/struct.File.html) will close it). Searching the docs, he sees the [`close`](https://docs.rs/sqlx/0.5.1/sqlx/trait.Connection.html#tymethod.close) method, but the comments confirm that he shouldn't have to call it explicitly: "This method is not required for safe and consistent operation. However, it is recommended to call it instead of letting a connection drop as the database backend will be faster at cleaning up resources." Still, just in case, he decides to add a call to `close` into his code. It does seem to help some, but he is still able to reproduce the problem if he refreshes often enough. Feeling confused, he adds a log statement right before calling `close` to see if it is working:
Copy file name to clipboardExpand all lines: src/vision/status_quo/barbara_trims_a_stacktrace.md
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ If you would like to expand on this story, or adjust the answers to the FAQ, fee
18
18
19
19
Barbara is triaging the reported bugs for her SLOW library. For each bug, she tries to quickly see if she can diagnose the basic area of code that is affected so she knows which people to ping to help fix it. She opens a bug report from a user complaining about a panic when too many connections arrive at the same time. The bug report includes a backtrace from the user's code, and it looks like this:
20
20
21
-
```
21
+
```ignore
22
22
thread 'main' panicked at 'something bad happened here', src/main.rs:16:5
23
23
stack backtrace:
24
24
0: std::panicking::begin_panic
@@ -74,7 +74,7 @@ Barbara finds the text overwhelming. She can't just browse it to figure out what
74
74
75
75
She's a bit confused by the `::{closure}` lines on her symbols but she learned by now that this is normal for `async fn`. After some work, she has reduced her stack to this:
76
76
77
-
```
77
+
```ignore
78
78
thread 'main' panicked at 'something bad happened here', src/main.rs:16:5
79
79
stack backtrace:
80
80
1: slow_rs::process_one::{{closure}} at ./src/main.rs:16:5
@@ -117,7 +117,7 @@ Fin.
117
117
<details>
118
118
<summary>(click to see how a backtrace looks in lldb)</summary>
0 commit comments