MessagingService:SubscribeAsync() can yield forever

On random servers, entirely unpredictably, except possibly related to hitting MessagingService limits, SubscribeAsync is able to yield infinitely (>15 minutes was tested) without throwing an error. On that server, attempting to call SubscribeAsync again with the same topic consistently reproduces the issue. This seems to have appeared in the last couple weeks/one month, with our bug reports going back ~1-2 weeks.

On our game, this manifested as a random bug occurring for a very small percentage of the playerbase, and only on specific servers, due to a reliance on MessagingService and failing to account for it possibly yielding infinitely. Since it’s so random, I have no specific reproduction steps or repro code.

This seems to be highlighted in old bug reports (which was fixed), along with some newer bug reports in the past few weeks, though those only regard team test servers; while this issue is happening in live servers.

We seem to periodically get MessagingService limit errors, but it’s not entirely clear if hitting the limits is related to this infinite yielding issue; there is no error thrown for the topic the infinite yield occurs on.

Expected behavior

The developer documentation states that the function “yields until the subscription is properly registered and returns a connection object”, but it is entirely unclear that this includes yielding forever. Either the documentation should be updated to make this clear, or more likely it is unintentional that it yields forever without throwing an error on only one topic.

A private message is associated with this bug report

Thanks for the report! We’ll follow up when we have an update for you.

Thanks for the report. Let’s track the issue at :SubscribeAsync() yields silently and indefinetly on Team Test - #4 by jjwu_play.

It appears the report you linked is related to team tests - while this is a production bug in live servers. Are you tracking both under the team test specific bug?

1 Like

Bumping this - will this be reopened or the live server issue tracked in the team test one? This seems separate.

I’m sorry I misread the report. Yeah this should be separate issue. We’ll look into it.

@Robin5D can you help confirm if this is still happening to your game since it’s been a few months? We’ll check to make sure we can properly handle all exceptional cases for this request.

Actually don’t know - we worked around it in production by deferring it with the task library as I recall. Only way we figured out was random, extremely rare occurrences in production being reported as bugs. Finally caught one of them in a live server and the specific topic was reproducible as infinitely yielding with developer console.

I’d just add it back to see if it happens again, but it really should have been designed with a defer in the first place in our code - so it’s less of a workaround and more how we should have been doing it before.

1 Like