osu icon indicating copy to clipboard operation
osu copied to clipboard

System.InvalidOperationException: Sequence contains more than one matching element

Open ppy-sentryintegration opened this issue 4 years ago • 5 comments

Sentry Issue: OSU-1MZ

System.InvalidOperationException: Sequence contains more than one matching element
  File "/usr/local/var/buildkite-agent/builds/ppybin-parallels-macos/ppy/osu/osu.Game/Online/Chat/MessageNotifier.cs", line 104, in void MessageNotifier.checkNewMessages(IEnumerable<Message> messages)
  File "/usr/local/var/buildkite-agent/builds/ppybin-parallels-macos/ppy/osu/osu.Game/Online/Chat/Channel.cs", line 125, in void Channel.AddLocalEcho(LocalEchoMessage message)
  File "/usr/local/var/buildkite-agent/builds/ppybin-parallels-macos/ppy/osu/osu.Game/Online/Chat/ChannelManager.cs", line 184, in void ChannelManager.PostMessage(string text, bool isAction, Channel target)+() => { }
  File "/usr/local/var/buildkite-agent/builds/ppybin-parallels-macos/ppy/osu/osu.Game/Online/Chat/ChannelManager.cs", line 164, in void ChannelManager.PostMessage(string text, bool isAction, Channel target)+dequeueAndRun()
  File "/usr/local/var/buildkite-agent/builds/ppybin-parallels-macos/ppy/osu/osu.Game/Online/Chat/ChannelManager.cs", line 229, in void ChannelManager.PostMessage(string text, bool isAction, Channel target)
...
(19 additional frame(s) were not displayed)

An unhandled error has occurred.

ppy-sentryintegration avatar May 28 '22 09:05 ppy-sentryintegration

Can't seem to make this one happen. About the only viable route wherein I can see this occurring is a race in getChannel() (the thought is that with two consecutive getChannel() calls from different threads, two copies may end up getting added to the list).

Exception site is

https://github.com/ppy/osu/blob/62266c72eab593476b1c4039bb717d714632fc88/osu.Game/Online/Chat/MessageNotifier.cs#L80

bdach avatar May 28 '22 10:05 bdach

I was able to reproduce this by opening multiple DMs quickly and sending a new message before the DM channel ID is resolved, as it appears to start with ID 0.

e.g.:

[runtime] 2022-06-08 00:59:55 [verbose]: Add new join channel: (0: Tillerino)
[runtime] 2022-06-08 00:59:55 [verbose]: --- Total channels:
[runtime] 2022-06-08 00:59:55 [verbose]: - 5: #osu
[runtime] 2022-06-08 00:59:55 [verbose]: - 38361781: #lazermp_66866
[runtime] 2022-06-08 00:59:55 [verbose]: - 38816787: #lazermp_70156
[runtime] 2022-06-08 00:59:55 [verbose]: - 44561527: #lazermp_121290
[runtime] 2022-06-08 00:59:55 [verbose]: - 44653052: #lazermp_122300
[runtime] 2022-06-08 00:59:55 [verbose]: - 47971347: #lazermp_191632
[runtime] 2022-06-08 00:59:55 [verbose]: - 6: #lobby
[runtime] 2022-06-08 00:59:55 [verbose]: - 14599138: #lazer
[runtime] 2022-06-08 00:59:55 [verbose]: - 0: osu!team
[runtime] 2022-06-08 00:59:55 [verbose]: - 0: Tillerino

frenzibyte avatar Jun 08 '22 01:06 frenzibyte

Sentry issue: OSU-206

ppy-sentryintegration avatar Jun 08 '22 04:06 ppy-sentryintegration

Looking at sentry this is still happening (last seen in 2022.923.1), so reopening for tracking.

bdach avatar Oct 16 '22 18:10 bdach

Yeah I have no idea about this, given the rarity of it occurring I'm going to un-assign myself for now.

frenzibyte avatar Oct 17 '22 01:10 frenzibyte