Commit a49bd65
authored
OnManagedConnectionFailed thread/memory leak fix (#1710)
Hi. I faced a problem with 'ConnectionMultiplexer': when it loses connection with Redis cluster, 'OnManagedConnectionFailed' event handler creates timer, which tries to 'SwitchMaster'. Timer ticks every second, but there is PLINQ query in 'GetConfiguredMasterForService' method, that leads to constantly threads starting (threads start faster than they exit). And if disconnect time is long enough, I get thread/memory leak in service.
PR contains hotfix of a problem with timer (timer starts next iteration only after previous iteration complete). But maybe you should take a closer look at PLINQ queries (they seem superfluous).
Also, I commented `TextWriter.Null` creation in 'SwitchMaster', because it seems like useless memory allocations (you handle nullable LogProxy).1 parent 119f6fa commit a49bd65
1 file changed
+11
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2477 | 2477 | | |
2478 | 2478 | | |
2479 | 2479 | | |
2480 | | - | |
2481 | | - | |
2482 | | - | |
2483 | | - | |
2484 | | - | |
| 2480 | + | |
| 2481 | + | |
| 2482 | + | |
2485 | 2483 | | |
2486 | 2484 | | |
2487 | 2485 | | |
| |||
2524 | 2522 | | |
2525 | 2523 | | |
2526 | 2524 | | |
2527 | | - | |
| 2525 | + | |
2528 | 2526 | | |
2529 | 2527 | | |
2530 | 2528 | | |
| |||
2533 | 2531 | | |
2534 | 2532 | | |
2535 | 2533 | | |
2536 | | - | |
2537 | 2534 | | |
2538 | | - | |
| 2535 | + | |
| 2536 | + | |
| 2537 | + | |
| 2538 | + | |
| 2539 | + | |
2539 | 2540 | | |
2540 | 2541 | | |
2541 | 2542 | | |
| |||
2730 | 2731 | | |
2731 | 2732 | | |
2732 | 2733 | | |
| 2734 | + | |
| 2735 | + | |
2733 | 2736 | | |
2734 | 2737 | | |
2735 | 2738 | | |
| |||
0 commit comments