Set up a Horde server and in the ‘credentials’ section of the .json files, where you put the Perforce username and password, add a valid username but put an invalid password. Start up the Horde server. Notice that in the log file, you will see a notification about failing to log in to the Perforce server. This will keep happening over and over (I think it was every 10 seconds).
If you use “p4 monitor show” on the Perforce server, you will see several idle threads from the user trying to log in via horde and the number of idle threads will keep growing and growing.
It looks like the Horde server is creating a connection to attempt to log into the Perforce server but never closes that connection.
I can fix this by modifying the async task ConnectAsync in PerforceService.cs and add a try/catch block around the handle.LoginAsync call. The failed login will throw an exception, so in the ‘catch’ block you can use handle.Dispose() to close the handle and then ‘throw’ to pass the exception up the stack.
Is that an acceptable way to fix this issue?
Does this problem still exist in Unreal Engine 5.7?
Steps to Reproduce
Set up a Horde server and in the ‘credentials’ section of the .json files, where you put the Perforce username and password, add a valid username but put an invalid password. Start up the Horde server. Notice that in the log file, you will see a notification about failing to log in to the Perforce server. This will keep happening over and over (I think it was every 10 seconds).
Hi Jeffrey, there as been no recent changes to p4 login calls in the new release. Could you attach the p4 diff -du for your changes and I can take a look at merge it in. Alternatively if you are assigned up to Epic’s GitHub org you can submit a PR if you like to receive acknowledgment on GH as well.
Thanks
Matthew
My only concern is that I don’t know if there are any unwanted side effects of this, but here’s the diff…
D:\dev\ue5>p4 diff -du d:\dev\ue5\Engine\Source\Programs\Horde\Plugins\Build\HordeServer.Build\Perforce\PerforceService.cs
--- //gbxcore/projects/ue5/Engine/Source/Programs/Horde/Plugins/Build/HordeServer.Build/Perforce/PerforceService.cs 2025-09-13 00:17:18.000000000 -0500
+++ D:\dev\ue5\Engine\Source\Programs\Horde\Plugins\Build\HordeServer.Build\Perforce\PerforceService.cs 2025-09-13 00:17:18.000000000 -0500
[Content removed]15 @@
if (!String.IsNullOrEmpty(credentials.Password) && String.IsNullOrEmpty(credentials.Ticket))
{
- await handle.LoginAsync(credentials.Password, cancellationToken);
+ try
+ {
+ await handle.LoginAsync(credentials.Password, cancellationToken);
+ }
+ catch (Exception ex)
+ {
+ handle.Dispose();
+ throw;
+ }
}
}
return handle;
Thanks for the diff. I don’t think there will be any side effects from this change. If you can’t login to p4 not much can be done until the password is corrected and the server config reloaded. I’ve added this PR to the team’s backlog for review.
Matthew