Skip to content

EFF-511 Fix Semaphore.take race condition#1392

Merged
tim-smart merged 2 commits intomainfrom
EFF-511/fix-semaphore-take-race-condition
Feb 21, 2026
Merged

EFF-511 Fix Semaphore.take race condition#1392
tim-smart merged 2 commits intomainfrom
EFF-511/fix-semaphore-take-race-condition

Conversation

@tim-smart
Copy link
Collaborator

Summary

  • port the v3 semaphore race fix by deferring permit acquisition in Semaphore.take until resumed execution, with a re-check that retries when permits are no longer available
  • add a regression test that reproduces the interruption race window and verifies interrupted waiters do not leak permits
  • add a changeset for the effect package (patch)

Validation

  • pnpm lint-fix
  • pnpm test packages/effect/test/Semaphore.test.ts
  • pnpm check
  • pnpm build
  • pnpm docgen

@changeset-bot
Copy link

changeset-bot bot commented Feb 21, 2026

🦋 Changeset detected

Latest commit: 8c62b55

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 26 packages
Name Type
effect Patch
@effect/opentelemetry Patch
@effect/platform-browser Patch
@effect/platform-bun Patch
@effect/platform-node-shared Patch
@effect/platform-node Patch
@effect/vitest Patch
@effect/ai-anthropic Patch
@effect/ai-openai-compat Patch
@effect/ai-openai Patch
@effect/ai-openrouter Patch
@effect/atom-react Patch
@effect/atom-solid Patch
@effect/atom-vue Patch
@effect/sql-clickhouse Patch
@effect/sql-d1 Patch
@effect/sql-libsql Patch
@effect/sql-mssql Patch
@effect/sql-mysql2 Patch
@effect/sql-pg Patch
@effect/sql-sqlite-bun Patch
@effect/sql-sqlite-do Patch
@effect/sql-sqlite-node Patch
@effect/sql-sqlite-react-native Patch
@effect/sql-sqlite-wasm Patch
@effect/openapi-generator Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Feb 21, 2026

📊 JSDoc Documentation Analysis

📈 Current Analysis Results
Analyzing 128 TypeScript files in packages/effect/src/ (including schema and config subdirectories)...

============================================================
         EFFECT JSDOC ANALYSIS REPORT
============================================================

📊 SUMMARY STATISTICS
------------------------------
Total files analyzed: 128
Total exported members: 4089
Missing @example: 2022 (49.4%)
Missing @category: 450 (11.0%)

🎯 TOP FILES NEEDING ATTENTION
----------------------------------------
1. Schema.ts
   📝 478 missing examples, 🏷️  266 missing categories
   📦 478 total exports
2. Array.ts
   📝 133 missing examples, 🏷️  2 missing categories
   📦 138 total exports
3. SchemaRepresentation.ts
   📝 96 missing examples, 🏷️  12 missing categories
   📦 96 total exports
4. SchemaAST.ts
   📝 77 missing examples, 🏷️  21 missing categories
   📦 77 total exports
5. Cause.ts
   📝 75 missing examples, 🏷️  2 missing categories
   📦 75 total exports
6. Channel.ts
   📝 73 missing examples, 🏷️  0 missing categories
   📦 144 total exports
7. Option.ts
   📝 66 missing examples, 🏷️  3 missing categories
   📦 66 total exports
8. Sink.ts
   📝 62 missing examples, 🏷️  2 missing categories
   📦 79 total exports
9. SchemaTransformation.ts
   📝 35 missing examples, 🏷️  24 missing categories
   📦 35 total exports
10. Predicate.ts
   📝 57 missing examples, 🏷️  0 missing categories
   📦 57 total exports
11. SchemaGetter.ts
   📝 49 missing examples, 🏷️  0 missing categories
   📦 49 total exports
12. Result.ts
   📝 46 missing examples, 🏷️  0 missing categories
   📦 46 total exports
13. Config.ts
   📝 33 missing examples, 🏷️  5 missing categories
   📦 33 total exports
14. Types.ts
   📝 37 missing examples, 🏷️  0 missing categories
   📦 37 total exports
15. JsonSchema.ts
   📝 16 missing examples, 🏷️  16 missing categories
   📦 16 total exports

✅ PERFECTLY DOCUMENTED FILES
-----------------------------------
   Chunk.ts (87 exports)
   Clock.ts (5 exports)
   FiberHandle.ts (15 exports)
   FiberMap.ts (19 exports)
   FiberSet.ts (14 exports)
   HKT.ts (4 exports)
   HashMap.ts (44 exports)
   HashSet.ts (21 exports)
   Latch.ts (3 exports)
   Match.ts (57 exports)
   MutableHashSet.ts (9 exports)
   MutableRef.ts (17 exports)
   NonEmptyIterable.ts (3 exports)
   Random.ts (7 exports)
   Redacted.ts (9 exports)
   RegExp.ts (3 exports)
   Runtime.ts (3 exports)
   Symbol.ts (1 exports)
   Trie.ts (29 exports)
   TxChunk.ts (22 exports)
   TxHashMap.ts (41 exports)
   TxHashSet.ts (24 exports)
   TxRef.ts (7 exports)
   TxSemaphore.ts (14 exports)
   Unify.ts (8 exports)
   index.ts (0 exports)

🔍 SAMPLE MISSING ITEMS FROM Schema.ts
-----------------------------------
   Optionality (type, line 63): missing example, category
   Mutability (type, line 70): missing example, category
   ConstructorDefault (type, line 77): missing example, category
   MakeOptions (interface, line 85): missing example, category
   Bottom (interface, line 109): missing example, category
   declareConstructor (interface, line 161): missing example, category
   declareConstructor (function, line 185): missing example
   declare (interface, line 209): missing example
   declare (function, line 218): missing example, category
   revealBottom (function, line 238): missing example, category

📋 BREAKDOWN BY EXPORT TYPE
-----------------------------------
const: 1022 missing examples, 130 missing categories
interface: 314 missing examples, 130 missing categories
type: 239 missing examples, 74 missing categories
function: 340 missing examples, 95 missing categories
namespace: 48 missing examples, 20 missing categories
class: 59 missing examples, 1 missing categories

📈 DOCUMENTATION PROGRESS
------------------------------
Examples: 2067/4089 (50.6% complete)
Categories: 3639/4089 (89.0% complete)

============================================================
Analysis complete! 2472 items need attention.
============================================================

📄 Detailed results saved to: jsdoc-analysis-results.json

This comment is automatically updated on each push. View the analysis script for details.

@github-actions
Copy link
Contributor

Bundle Size Analysis

File Name Current Size Previous Size Difference
basic.ts 6.33 KB 6.33 KB 0.00 KB (0.00%)
batching.ts 8.58 KB 8.58 KB 0.00 KB (0.00%)
brand.ts 6.24 KB 6.24 KB 0.00 KB (0.00%)
cache.ts 9.78 KB 9.78 KB 0.00 KB (0.00%)
config.ts 16.43 KB 16.43 KB 0.00 KB (0.00%)
differ.ts 14.63 KB 14.63 KB 0.00 KB (0.00%)
http-client.ts 19.49 KB 19.49 KB 0.00 KB (0.00%)
logger.ts 9.75 KB 9.75 KB 0.00 KB (0.00%)
metric.ts 8.87 KB 8.87 KB 0.00 KB (0.00%)
optic.ts 7.49 KB 7.49 KB 0.00 KB (0.00%)
pubsub.ts 13.40 KB 13.40 KB 0.00 KB (0.00%)
queue.ts 11.13 KB 11.13 KB 0.00 KB (0.00%)
schedule.ts 10.08 KB 10.08 KB 0.00 KB (0.00%)
schema-representation-roundtrip.ts 24.33 KB 24.33 KB 0.00 KB (0.00%)
schema-string-transformation.ts 12.05 KB 12.05 KB 0.00 KB (0.00%)
schema-string.ts 9.86 KB 9.86 KB 0.00 KB (0.00%)
schema-template-literal.ts 12.41 KB 12.41 KB 0.00 KB (0.00%)
schema-toArbitraryLazy.ts 16.63 KB 16.63 KB 0.00 KB (0.00%)
schema-toCodeDocument.ts 19.54 KB 19.54 KB 0.00 KB (0.00%)
schema-toCodecJson.ts 15.51 KB 15.51 KB 0.00 KB (0.00%)
schema-toEquivalence.ts 15.79 KB 15.79 KB 0.00 KB (0.00%)
schema-toFormatter.ts 15.64 KB 15.64 KB 0.00 KB (0.00%)
schema-toJsonSchemaDocument.ts 18.25 KB 18.25 KB 0.00 KB (0.00%)
schema-toRepresentation.ts 16.43 KB 16.43 KB 0.00 KB (0.00%)
schema.ts 15.28 KB 15.28 KB 0.00 KB (0.00%)
stm.ts 12.12 KB 12.12 KB 0.00 KB (0.00%)
stream.ts 8.81 KB 8.81 KB 0.00 KB (0.00%)

@tim-smart tim-smart enabled auto-merge (squash) February 21, 2026 11:35
@tim-smart tim-smart merged commit 856d774 into main Feb 21, 2026
14 checks passed
@tim-smart tim-smart deleted the EFF-511/fix-semaphore-take-race-condition branch February 21, 2026 11:38
pixeleet pushed a commit to type-driven/effect-smol that referenced this pull request Feb 23, 2026
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.

1 participant