Commit aa79ee9
committed
fix(consumer): drain in-flight bootstrap consume workers before unsubscribe
The bootstrap consumer uses setInterval(200ms) to call consume(1, cb),
creating multiple concurrent C++ async workers (each with a 1000ms
timeout). Since librdkafka 2.10.0, these workers survive an
unsubscribe→subscribe transition and can dequeue messages from the next
subscription, causing them to be lost to the normal consume pipeline.
Track in-flight workers with a counter and defer unsubscribe() until
all have completed.
Issue: BB-7601 parent 1735ada commit aa79ee9
1 file changed
Lines changed: 27 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
873 | 873 | | |
874 | 874 | | |
875 | 875 | | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
876 | 900 | | |
| 901 | + | |
877 | 902 | | |
878 | 903 | | |
879 | 904 | | |
| |||
888 | 913 | | |
889 | 914 | | |
890 | 915 | | |
891 | | - | |
892 | | - | |
893 | | - | |
894 | | - | |
895 | | - | |
896 | | - | |
897 | | - | |
898 | | - | |
899 | | - | |
900 | | - | |
901 | | - | |
| 916 | + | |
902 | 917 | | |
903 | 918 | | |
904 | 919 | | |
| |||
928 | 943 | | |
929 | 944 | | |
930 | 945 | | |
| 946 | + | |
931 | 947 | | |
932 | 948 | | |
933 | 949 | | |
| |||
0 commit comments