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

[executor] Simplify Logic + Speed Up Tests #831

Merged
merged 13 commits into from
Apr 12, 2024
Merged

Conversation

patrick-ogrady
Copy link
Contributor

No description provided.

@patrick-ogrady patrick-ogrady changed the base branch from main to scheduler-v3 April 12, 2024 12:55
// baseDependencies must be greater than the maximum number of dependencies
// any single task could have. This is used to ensure a dependent task
// does not begin executing a task until all dependencies have been enqueued.
const baseDependencies = 100_000_000
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@wlawt I think this was the main nuance you didn't include in your branch

@@ -28,23 +33,17 @@ type Executor struct {
outstanding sync.WaitGroup
executable chan *task

tasks map[int]*task
Copy link
Contributor Author

Choose a reason for hiding this comment

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

When possible, we should avoid ever keeping a central map we use for lookup (as it requires synchronization).

@patrick-ogrady patrick-ogrady marked this pull request as draft April 12, 2024 12:58
@patrick-ogrady
Copy link
Contributor Author

Load tests are stuck on waiting for executable after all items enqueued...this means some item is getting dropped somewhere or that its dependencies weren't decremented.

@patrick-ogrady
Copy link
Contributor Author

217 (in this run) is never executed:

dependencies remaining 217 1
dependencies remaining 218 1
queued 219
queued 220
queued 221
queued 222
queued 223
queued 224
queued 225
dependencies remaining 226 1
queued 227
queued 228
queued 229
queued 230
queued 231
queued 232
dependencies remaining 233 1
queued 234
queued 235
queued 236
queued 207
queued 237
queued 238
queued 239
queued 240
queued 241
queued 242
queued 243
queued 244
queued 245
queued 246
queued 247
queued 248
queued 249
queued 250
queued 251
queued 252
queued 253
queued 254
queued 255
queued 210
queued 109
queued 233
queued 218
queued 226
queued 152

@patrick-ogrady
Copy link
Contributor Author

load test is failing with:

skipped 246 block full
skipped 247 block full
skipped 248 block full
skipped 244 block full
skipped 245 block full
base queued 249
base queued 250
base queued 251
skipped 221 block full
skipped 250 block full
skipped 251 block full
skipped 249 block full
base queued 252
base queued 253
base queued 254
base queued 255
skipped 253 block full
skipped 255 block full
skipped 254 block full
skipped 252 block full

@patrick-ogrady patrick-ogrady marked this pull request as ready for review April 12, 2024 14:00
@wlawt wlawt merged commit dafea5b into scheduler-v3 Apr 12, 2024
23 checks passed
patrick-ogrady added a commit that referenced this pull request Apr 17, 2024
…ys (#814)

* [executor] refactor worker func

* [executor] renaming

* [executor] use blocking/dependency type from programmatic-deploy fork

* [executor] add key type support

* wip

* wip

* switch statements

* programmatic deploy fork + concurrent reads work

* sequential writes work

* w->r->r works

* r->r->w works

* w->r->r...w->r->r works

* r->r->w...r->r->w works

* all unit tests pass

* cleanup

* coverage 97%

* cleanup switch

* switch comments

* self review

* go mod tidy

* add done prints to tests

* rename isAllocateWrite

* remove id from task

* use dummy dep to keep track of all keys

* simplify for loop in adding bt dep

* fix integration bug and add unit test for it

* fix race condition with write-after-read(s) potentially

* run unit tests over multiple iterations

* cut down on unit testing time and add comments

* simplify num times we call add blocking if not exec

* new way to keep track of concurrent Reads

* self review

* have unit tests run under max time

* [executor] Simplify Logic + Speed Up Tests (#831)

* first pass

* need to set higher base dependencies

* remove extra logging from tests

* use right var

* tests passing

* cleanup task loop

* make tests faster

* ensure arr order matches

* add more comments

* tests are passing

* ensure we actually stop building early

* add comment about failure case

* add comment about deadlock

* better var names

* add larger unit tests

* ignore lint for rand

* add unique and conflicting keys randomly to txs

* fix for loops

* use max function

* make conflict keys 100 and pick 1-5

* make num slow chan consistent

* use set.Contains to speed up tests

* random perm for each unique key

* group var names

* use numTxs in generating blocking txs

* increase num conflict keys for concurrent Reads and Writes test

* [executor] multi-key conflict bug (#837)

* random perm per conflict key

* fix dont block on ourself and edit TestTwoConflictKeys to track this

* keep reading/readers relationship

* make reading a map

* comments

* clarify use of map for reading

* simplify rng for conflict and unique perm

* random perm per conflict key

* make maxDep a param

* add maxDep as const in chain

* placement of maxDep comment

---------

Co-authored-by: Patrick O'Grady <prohb125@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants