-
Notifications
You must be signed in to change notification settings - Fork 27k
fix(core): don't coerce all producers to consumers on liveness change #56140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
When a consumer switches its liveness state, it gets added to / removed from the consumer list of all of its producers. This operation is transitive, so if its producer is *also* a consumer and *its* liveness state is switched, then the change is applied recursively. Note that this only matters *if* the producer is also a consumer. However, the logic in `producerAddLiveConsumer` / `producerRemoveLiveConsumerAtIndex` coerced the producer node into a producer & consumer node, which allocated extra arrays into the node structure that are never used. This didn't affect correctness, but increased the memory usage of plain signal nodes (which are just producers, never consumers). This fix changes the logic in those operations to simply check if a producer is also a consumer instead of coercing it into one.
|
Caretaker: TGP not needed; no significant behavioral change. |
|
Caretaker: consider this globally approved :) Pawel's review is sufficient. |
|
TESTED=TGP Not required. No significant behavioral change. |
…#56140) When a consumer switches its liveness state, it gets added to / removed from the consumer list of all of its producers. This operation is transitive, so if its producer is *also* a consumer and *its* liveness state is switched, then the change is applied recursively. Note that this only matters *if* the producer is also a consumer. However, the logic in `producerAddLiveConsumer` / `producerRemoveLiveConsumerAtIndex` coerced the producer node into a producer & consumer node, which allocated extra arrays into the node structure that are never used. This didn't affect correctness, but increased the memory usage of plain signal nodes (which are just producers, never consumers). This fix changes the logic in those operations to simply check if a producer is also a consumer instead of coercing it into one. PR Close #56140
|
This PR was merged into the repository by commit 1081c8d. |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
When a consumer switches its liveness state, it gets added to / removed from the consumer list of all of its producers. This operation is transitive, so if its producer is also a consumer and its liveness state is switched, then the change is applied recursively.
Note that this only matters if the producer is also a consumer. However, the logic in
producerAddLiveConsumer/producerRemoveLiveConsumerAtIndexcoerced the producer node into a producer & consumer node, which allocated extra arrays into the node structure that are never used. This didn't affect correctness, but increased the memory usage of plain signal nodes (which are just producers, never consumers).This fix changes the logic in those operations to simply check if a producer is also a consumer instead of coercing it into one.
Other information