Skip to content
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

agent: fix performance leak, smp server: optimize and fix potential memory leak #1004

Merged
merged 10 commits into from
Feb 21, 2024

Conversation

epoberezkin
Copy link
Member

@epoberezkin epoberezkin commented Feb 20, 2024

  1. Fix performance degradation when re-connecting SMP clients (see comment in Simplex.Messaging.Agent.Client).
  2. Only make active subscriptions pending if the disconnected client was current (check and change are in one STM transaction).
  3. Remove unused timeoutPerBlock.
  4. smp server:
  • determine that client is the same based on client ID (faster comparison).
  • more efficient processing of removing subscriptions when client disconnects (replace STM loop with pure fold).
  • track and remove threads for END delivery when client disconnects to avoid them hanging in case of two many ENDs not fitting the queue preventing the client from being GCd.

@epoberezkin epoberezkin force-pushed the ep/fix-performance-leak branch from 7559993 to 7325a35 Compare February 20, 2024 19:50
@epoberezkin epoberezkin changed the title fix agent performance leak when re-connecting clients, optimize SMP server agent: fix performance leak, smp server: optimize and fix potential memory leak Feb 20, 2024
@epoberezkin epoberezkin changed the base branch from master to stable February 20, 2024 22:47
@epoberezkin epoberezkin changed the base branch from stable to master February 20, 2024 22:47
@epoberezkin epoberezkin force-pushed the ep/fix-performance-leak branch from 9a69147 to fa21d50 Compare February 20, 2024 22:53
@epoberezkin epoberezkin changed the base branch from master to stable February 20, 2024 22:53
@epoberezkin epoberezkin force-pushed the ep/fix-performance-leak branch from fa21d50 to 0bf8dce Compare February 21, 2024 08:55
@epoberezkin epoberezkin changed the base branch from stable to v5521 February 21, 2024 08:55
@epoberezkin epoberezkin merged commit 03c24c3 into v5521 Feb 21, 2024
3 checks passed
@epoberezkin epoberezkin deleted the ep/fix-performance-leak branch February 21, 2024 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants