-
Notifications
You must be signed in to change notification settings - Fork 0
chore: prepare 0.10.0 #27
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| # rbs_inline: enabled | ||
|
|
||
| module SolidObjects | ||
| VERSION = "0.9.0" | ||
| VERSION = "0.10.0" | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The process-wide
sql.active_recordsubscriber measures the synchronous call whileworker.runconcurrently performs heartbeat, activation-maintenance, claim, and drain queries. Those background queries are included in the reported total, so the result does not isolate one synchronous invocation and its documented determinism depends on thread timing.Prompt To Fix With AI
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct, and it changed the answer. Fixed in 8bb4491.
count_queriesnow scopes to the measuring thread. Notifications run on the thread that issued the query, soThread.current.equal?(measuring)excludes the worker entirely. The caller and the worker turn are measured separately rather than by watching both threads at once, because a poll belongs to no particular call.This also corrects a claim I made in the PR body. With the worker excluded, the caller of a synchronous call costs 49 queries, which is exactly what the docs already said. The 53 I reported was four stray polls landing in the window. Five identical runs made it look deterministic when it was only consistent on this machine, which is the trap you caught.
The message-turn drift is real and stands: 26 against a documented 29. That measurement calls
worker.run_onceon the measuring thread with no other thread alive, so it was never contaminated.The script now reports three numbers, all stable across five runs:
The 75 is new. A synchronous call is a caller plus a worker turn, and only the sum says what the database actually serves for one call.
docs/benchmarks.mdand the changelog now carry all three plus the reason counting is thread-scoped.bundle exec rake: 366 runs, 1253 assertions, 0 failures, 0 errors, 13 skips.@greptileai review
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fix in 8bb4491 is correct and directly addresses the contamination concern.
count_queriesnow capturesThread.currentasmeasuringbefore subscribing, and thesql.active_recordblock exits early unlessThread.current.equal?(measuring). Because ActiveSupport notifications fire on the thread that issued the query, the worker's polls are structurally excluded — no timing window to fall into.The separation is also the right design:
message_turn_query_countrunsworker.run_onceon the measuring thread with no other thread alive (clean by construction), whilesynchronous_caller_query_countruns the worker on a separate thread and counts only the caller. Combining them ascaller + turnfor the 75-query total is a sound way to express what the database actually serves for one synchronous call.The
queriescounter is only ever incremented from the measuring thread (guarded by theequal?check), so no mutex is needed — that's correct too.The original comment stands resolved.