Commit e29ee24
authored
fix: fdv2 datasystem leaves sychronizer open after client is closed (#337)
**Requirements**
- [ ] I have added test coverage for new or changed functionality
- [x] I have followed the repository's [pull request submission
guidelines](../blob/v5/CONTRIBUTING.md#submitting-pull-requests)
- [x] I have validated my changes against all supported platform
versions
**Describe the solution you've provided**
This update modifies the runSynchronizers method to ensure that both
primary and secondary synchronizers are closed before returning due to a
client shutdown.
**Describe alternatives you've considered**
Alternatively, we could handle the context cancelling in the
synchronizer implementation, but this is a less disruptive change.
**Additional context**
Take a look at jira issue for a more detailed investigation of the
problem
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Always close primary and secondary synchronizers after processing
results, even when context is canceled, to avoid leaving them open after
client shutdown.
>
> - **FDv2 DataSystem (`internal/datasystem/fdv2_datasystem.go`)**:
> - Ensure `primarySync.Close()` and `secondarySync.Close()` are invoked
immediately after `consumeSynchronizerResults`, before checking for
`context.Canceled`.
> - Prevents leaving synchronizers running by closing them
unconditionally after each sync cycle.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
5a76595. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent bd72e1d commit e29ee24
1 file changed
+8
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
288 | 288 | | |
289 | 289 | | |
290 | 290 | | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
291 | 295 | | |
292 | 296 | | |
293 | | - | |
294 | | - | |
295 | 297 | | |
296 | 298 | | |
297 | 299 | | |
| |||
327 | 329 | | |
328 | 330 | | |
329 | 331 | | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
330 | 336 | | |
331 | 337 | | |
332 | | - | |
333 | | - | |
334 | 338 | | |
335 | 339 | | |
336 | 340 | | |
| |||
0 commit comments