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
fix: pebble shutdown needs to handle async execution (#3114)
* fix issue with pebble not performing full shutdown and silently erroring
* remove test that is irrelevant due to otel architecture
* add to readme
* add asyncDone to compaction job as well
* account for pr feedback
Copy file name to clipboardExpand all lines: extension/pebbleextension/README.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,7 @@ The Pebble Extension provides persistent storage for OpenTelemetry Collector com
12
12
| sync | bool | true | No | Whether to sync writes to disk after every write. `true` offers safer durability guarantees. Setting `false` may improve performance but increases the chance of data loss in the event of a crash. |
13
13
| compaction.interval | duration | 30m | No | How often background compaction runs (e.g., "30m" for 30 minutes). Compaction reclaims space from deleted entries. Set to 0s to disable background compaction. |
14
14
| compaction.compaction_concurrency | uint64 | 3 | No | Number of concurrent background compaction jobs permitted. Increase for higher compaction throughput or decrease for reduced interference with other workloads. |
15
+
| close_timeout | duration | 10s | No | Maximum time to wait for in-flight async operations to complete during shutdown. After this timeout, Close returns an error. |
15
16
16
17
## Example Configuration
17
18
@@ -45,6 +46,7 @@ For advanced use cases, the following configuration options are exposed:
45
46
- **sync**: Controls write durability. The default (`true`) provides safer durability guarantees by syncing writes to disk immediately.
46
47
- **compaction.interval**: Controls how often background compaction checks run (default: 30 minutes). Set to 0 to disable background compaction.
47
48
- **compaction.concurrency**: Controls how many folders will be attempted to be compacted at the given interval (default: `3`). This parameter helps avoid causing way too many resources being used for compaction.
49
+
- **close_timeout**: Maximum time to wait for in-flight async operations to complete during shutdown (default: 10s). If async operations do not complete within this window, Close returns an error.
48
50
49
51
Refer to the [Pebble documentation](https://github.com/cockroachdb/pebble) for detailed information about the database.
// Close closes the client and waits for any async operations to complete.
218
+
// Note that since extensions shutdown are done after the other components are shutdown, we can safely assume that no new operations will be performed before this call.
222
219
func (c*client) Close(_ context.Context) error {
223
-
ifc.doneChan!=nil {
224
-
close(c.doneChan)
220
+
ifc.closed.Load() {
221
+
c.logger.Info("pebble instance is already closed, skipping")
0 commit comments