Skip to content

Fix/backfill performance - #63

Open
edge-marge wants to merge 8 commits into
devfrom
fix/backfill-performance
Open

edge-marge wants to merge 8 commits into
devfrom
fix/backfill-performance

Conversation

@edge-marge

Copy link
Copy Markdown
Contributor

No description provided.

@orcist orcist left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good set of changes, posted a few comments but nothing seriously impacting functionality I think.

Comment thread Runtime/Matchmaking/ServerAgent.cs Outdated
Backfills._Update(newBackfills, $"removed [{backfillID}]");
Backfills._Update(
newBackfills,
$"{(backfills[backfillID].Status == "ASSIGNED" ? "assigned" : "removed")} [{backfillID}]"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the check for assigned? We have the polling function which will emit the same update when assigned, this seems duplicate. This is just removing the local reference, removing should always happen only after the ticket has been already assigned or if it has been abandoned. Maybe we can omit the assigned check here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's not duplicate; i moved that update message here & i'm calling RemoveBackfill back again in the polling function (it got removed at some point?) so that the count in AddBackfills is correct => plannedBackfills = TargetTeamSize - (Assignments.Count + Backfills.Current.Count)

@orcist orcist Sep 15, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for explaining -> so we don't emit the removed event for backfills which get assigned. This implies automated removal of assigned backfills, I think it would be better to explicitly emit assigned (in the callback when polling backfills) and then removed right after (in the remove method). Emitting assigned event in the remove method seems counterintuitive and prone to human mistake if we make changes to server agent in the future. Case in point - me misunderstanding the intended flow after reading the code...

Also, some matchmaking options out there do not have this implication and an open backfill feature keeps adding players until manually stopped. I'd rather make it obvious by reading the log that it was assigned and removed right after.

Comment thread Runtime/Matchmaking/ServerAgent.cs Outdated
using System.Collections;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this important really needed? maybe accidentally included?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah its's needed for when I check whether the consecutiveErrors counter needs to be incremented or reset when polling

@orcist orcist Sep 15, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure about that? Maybe I'm misunderstanding, but that counter is just an integer, that shouldn't need linq.

EDIT: I think I get it, you need linq for the ConcurrentQueue.Contains method?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah exactly

@orcist orcist left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small change requests, feel free to DM me if it helps close this faster.

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