question

benjaminsims avatar image
benjaminsims asked

Servers not shutting down after update to Unity 2021.3.1

After updating Unity, our servers are no longer shutting down.

We've checked logs and ensured that Application.Quit is definitely getting called and no exceptions are being thrown.

It seems like PlayFab isn't detecting that the application has closed, and the server never shuts down as a result.

Is anyone aware of something that we need to change in our code as a result of the Unity update?

We noticed that Unity now has a dedicated server build target, which we've started using, however the issue still seems to occur.

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Gosen Gao avatar image Gosen Gao commented ·

Can you RDP into that VM to see the state of your server build?

0 Likes 0 ·
benjaminsims avatar image
benjaminsims answered

Yeah, I've RDP'd in and found that Unity seems to be stuck on shutting down after calling Application.Quit. I'm not sure if it's due to another thread, however the issue seems to be on Unity's side.

For now we've worked around the issue using Process.GetCurrentProcess().Kill.
I'm hoping Unity will get back to me with a solution soon, as it seems to be related to the Unity version update.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Dimitris-Ilias Gkanatsios avatar image
Dimitris-Ilias Gkanatsios answered

Does the process shutdown when Application.Quit is called?

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

benjaminsims avatar image benjaminsims commented ·

Nah, we're able to veryify that Application.Quit is being called, and any callbacks are invoked, however Unity seems to hang when trying to shut down the application, but this only seems to be occuring on PlayFab server environments, as we can't reproduce it locally.

0 Likes 0 ·
Dimitris-Ilias Gkanatsios avatar image
Dimitris-Ilias Gkanatsios answered

I would also assume that the Unity process is the main process that starts when your game starts, correct?

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

benjaminsims avatar image benjaminsims commented ·

Yep, that's correct.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.