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

Condition assignment sometimes stalls out #97

Open
emilyliquin opened this issue Jan 30, 2024 · 2 comments
Open

Condition assignment sometimes stalls out #97

emilyliquin opened this issue Jan 30, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@emilyliquin
Copy link
Contributor

Lots of people (at least 100) started a study all within a minute or two of each other. The way the condition assignment works is that it reads which condition has the lowest number of participants, then it assigns the participant to that one (to keep condition assignment balanced). BUT if the number of participants has changed in the time it takes to read the conditions and attempt to assign the participant, it will retry. It will keep retrying until one of two things has happened: (1) the numbers in the database are stable in the time it takes to read/write, or (2) 4.5 minutes has elapsed. I think what might have happened is that it was still retrying, because 4.5 minutes hadn’t elapsed and the numbers hadn’t stabilized (because there were so many people the condition counts kept changing). My study is pretty short, so they got to the point in the study where the condition assignment became relevant before the 4.5 minutes was up. This would mean (1) no errors from the transaction assigning condition, because it was still ongoing, but (2) errors from the code that requires condition, because it hasn’t been set yet.

Solution to implement: Retry transaction for a shorter amount of time, and then fallback to assigning truly randomly (rather than balanced random)? And maybe do a check when condition variabless are used to ensure that they've been set.

@emilyliquin emilyliquin added the bug Something isn't working label Jan 30, 2024
@emilyliquin emilyliquin self-assigned this Jan 30, 2024
@emilyliquin
Copy link
Contributor Author

In theory c601d19 fixes this issue, but needs to be tested

@emilyliquin
Copy link
Contributor Author

still unresolved: if existing firestore conditions counter doesn't use the distributed shards thing, it doesn't work (only works for creating new one)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant