agones icon indicating copy to clipboard operation
agones copied to clipboard

Unity Client SDK hangs when making local http calls

Open austin-space opened this issue 2 years ago • 2 comments

What happened: The Unity Client SDK hangs when calling await-ing methods like .Connect() or .Ready a vast majority of the time, despite the sidecar logs indicating a successful return.

What you expected to happen: The calls to execute and the await to complete as soon as the calls do.

How to reproduce it (as minimally and precisely as possible): Create a new unity project, attach the Unity Client SDK as instructed in the docs and attempt to call ready.

Anything else we need to know?: We figured this one out after a good chunk of debugging. It looks like the code for AgonesAsyncOperationAwaiter relies on getting set up before the operation in question has returned, but for operations that have already returned(for example most local http calls) the completed callback has already been called, so we just hang forever waiting.

Also, for whatever reason, ContinueWith appears to almost never succeed. It's also unnecessary and can be replaced with something like:

var result = await SendRequestAsync();
return result.ok;

I suspect this might be a unity version issue, as we also noticed that the AgonesAlphaSdk uses a version of C# that is incompatible with all but the most recent version of unity(as opposed to the prerequisites which indicate 2018.x compatibility)

Environment:

  • Agones version: 1.27
  • Kubernetes version (use kubectl version): N/A
  • Cloud provider or hardware configuration: N/A
  • Install method (yaml/helm): N/A
  • Troubleshooting guide log(s):N/A
  • Others: unity version is 2020

austin-space avatar Nov 17 '22 23:11 austin-space

It feels like there were some changes in Unity that breaks our SDK (we should also update supported version numbers too). Would love some help in fixing from someone who works more in Unity than many of us do here.

markmandel avatar Nov 18 '22 20:11 markmandel

'This issue is marked as Stale due to inactivity for more than 30 days. To avoid being marked as 'stale' please add 'awaiting-maintainer' label or add a comment. Thank you for your contributions '

github-actions[bot] avatar Feb 15 '24 10:02 github-actions[bot]

This issue is marked as obsolete due to inactivity for last 60 days. To avoid issue getting closed in next 30 days, please add a comment or add 'awaiting-maintainer' label. Thank you for your contributions

github-actions[bot] avatar Apr 01 '24 02:04 github-actions[bot]