Commit graph

12585 commits

Author SHA1 Message Date
Łukasz Domeradzki
5605e9a666
Misc 2024-08-18 01:59:25 +02:00
Łukasz Domeradzki
337b720d31
Misc deduplication 2024-08-18 01:53:13 +02:00
Łukasz Domeradzki
06185d5f7d
Misc 2024-08-17 22:19:17 +02:00
Łukasz Domeradzki
90cfdd140b
Bump 2024-08-17 21:45:40 +02:00
Łukasz Domeradzki
5a41d559a3
Misc
No point in making this available for all IEnumerables, only ICollections are affected
2024-08-16 03:35:09 +02:00
Łukasz Domeradzki
b6805a94a3
Add workaround for LINQ race condition with concurrent collections
This is some next-level race condition, so for those interested:
- Concurrent collections are thread-safe in a way that each operation is atomic
- Naturally if you call two atomic operations in a row, the result is no longer atomic, since there could be some changes between the first and the last
- Certain LINQ operations such as OrderBy(), Reverse(), ToArray(), among more, use internal buffer for operation with certain optimization that checks if input is ICollection, if yes, it calls Count and CopyTo(), for OrderBy in this example
- In result, such LINQ call is not guaranteed to be thread-safe, since it assumes those two calls to be atomic, while they're not in reality.

This issue is quite hard to spot in real applications, since it's not that easy to trigger it (you need to call the operation on ICollection and then have another thread modifying it while enumerating). This is probably why we've never had any real problem until I've discovered this madness with @Aareksio in entirely different project.

As a workaround, we'll explicitly convert some ICollection inputs to IEnumerable, in particular around OrderBy(), so the optimization is skipped and the result is not corrupted.

I've added unit tests which ensure this workaround works properly, and you can easily reproduce the problem by removing AsLinqThreadSafeEnumerable() in them.

See https://github.com/dotnet/runtime/discussions/50687 for more insight

I have no clue who thought that ignoring this issue is a good idea, at the very least concurrent collections should have opt-out mechanism from those optimizations, there is no reason for them to not do that.
2024-08-16 03:25:58 +02:00
renovate[bot]
6a678cd5a9
chore(deps): update github/codeql-action action to v3.26.2 2024-08-14 16:30:56 +00:00
renovate[bot]
ecaf61252a chore(deps): update asf-ui digest to 6900304 2024-08-14 08:46:01 +00:00
ArchiBot
85c4e4ac37
Automatic translations update 2024-08-14 02:14:19 +00:00
renovate[bot]
16394182b2
chore(deps): update github/codeql-action action to v3.26.1 2024-08-13 23:09:58 +00:00
renovate[bot]
a0cc53cbb7
chore(deps): update docker/build-push-action action to v6.7.0 2024-08-13 19:17:41 +00:00
renovate[bot]
f331ee2c24
chore(deps): update dependency mstest to v3.5.2 2024-08-13 17:39:50 +00:00
renovate[bot]
cb0767f28e
chore(deps): update dependency microsoft.codeanalysis.resxsourcegenerator to v3.11.0-beta1.24324.1 2024-08-13 13:40:40 +00:00
renovate[bot]
91aaf3be19
chore(deps): update dependency nlog.web.aspnetcore to v5.3.12 2024-08-13 04:29:59 +00:00
ArchiBot
9540e564fc
Automatic translations update 2024-08-13 02:15:24 +00:00
renovate[bot]
2100d6287c
chore(deps): update asf-ui digest to 184c664 2024-08-12 01:06:04 +00:00
ArchiBot
8ad8183d4f
Automatic translations update 2024-08-11 02:16:59 +00:00
Łukasz Domeradzki
90f2d93768
Optimize mobile authenticator, add unit tests 2024-08-11 02:21:00 +02:00
renovate[bot]
bae8dc330c
chore(deps): update asf-ui digest to 1136a49 2024-08-10 04:23:27 +00:00
ArchiBot
599ca4d2c9
Automatic translations update 2024-08-10 02:13:43 +00:00
Łukasz Domeradzki
ff7a1e7c0e
Misc optimization 2024-08-09 23:03:56 +02:00
renovate[bot]
216cd51c4a
chore(deps): update actions/attest-build-provenance action to v1.4.1 2024-08-09 17:47:24 +00:00
Łukasz Domeradzki
568e9935ac
Bump 2024-08-08 14:19:46 +02:00
renovate[bot]
28e9247c9a
chore(deps): update docker/build-push-action action to v6.6.1 2024-08-07 21:16:33 +00:00
renovate[bot]
df3f16d424
chore(deps): update jetbrains/qodana-action action to v2024.1.9 2024-08-07 15:40:18 +00:00
renovate[bot]
41d03a15ac
chore(deps): update docker/build-push-action action to v6.6.0 2024-08-07 12:26:35 +00:00
renovate[bot]
3f0e67075f
chore(deps): update asf-ui digest to eb4cb97 2024-08-07 03:57:07 +00:00
ArchiBot
67329ec668
Automatic translations update 2024-08-07 02:14:49 +00:00
Łukasz Domeradzki
f28d783272
Misc 2024-08-07 03:15:22 +02:00
Łukasz Domeradzki
2c9d015f38
Fix @xPaw breaking changes
How could you!
2024-08-07 03:02:04 +02:00
renovate[bot]
5ad8a93d48 chore(deps): update dependency steamkit2 to v3.0.0-beta.1 2024-08-06 22:11:53 +00:00
renovate[bot]
ac9c1504e9
chore(deps): update github/codeql-action action to v3.26.0 2024-08-06 18:12:59 +00:00
renovate[bot]
4cde913453
chore(deps): update actions/upload-artifact action to v4.3.6 2024-08-06 15:22:49 +00:00
Łukasz Domeradzki
f05d041e6d
Bump 2024-08-06 12:31:56 +02:00
Łukasz Domeradzki
ce4b41ee73
Misc 2024-08-06 12:04:52 +02:00
Łukasz Domeradzki
0c3c4c08ea
Rewrite callbacks handling loop to new mechanism 2024-08-06 12:02:38 +02:00
renovate[bot]
67d9486495
chore(deps): update asf-ui digest to bd3816f 2024-08-06 04:11:38 +00:00
ArchiBot
bd00911f85
Automatic translations update 2024-08-06 02:12:59 +00:00
Łukasz Domeradzki
4cb3123ff6
Update BotConfig.cs 2024-08-06 03:12:06 +02:00
Łukasz Domeradzki
4ff1411c38
Closes #3261 2024-08-06 03:07:41 +02:00
Łukasz Domeradzki
f983a2eab2
Refactor UserInterfaceMode, kill SetCurrentMode() 2024-08-06 03:00:14 +02:00
renovate[bot]
fd7c86c2da
chore(deps): update dependency mstest to v3.5.1 2024-08-05 22:17:22 +00:00
renovate[bot]
d90aa1798b
chore(deps): update dependency steamkit2 to v3.0.0-alpha.3 2024-08-05 11:59:40 +00:00
Łukasz Domeradzki
afa602f940
Resolve remainings of CA1863 2024-08-05 02:45:53 +02:00
Łukasz Domeradzki
773698a0d4
Closes #3264
THANKS @ezhevita
2024-08-05 02:37:50 +02:00
Łukasz Domeradzki
08907e8953
Emit format methods for ItemsMatcher, #3264 2024-08-05 02:15:58 +02:00
Łukasz Domeradzki
332e9a53d7
Misc 2024-08-05 01:44:34 +02:00
Łukasz Domeradzki
7a8e2091a6
Use Microsoft.CodeAnalysis.ResxSourceGenerator for localization 2024-08-05 01:42:09 +02:00
Łukasz Domeradzki
3ed05b8e26
Bump 2024-08-03 15:55:53 +02:00
Łukasz Domeradzki
d3dbfc5e9e
Closes #3262 2024-08-03 15:36:45 +02:00