Disable UDPPacketBuffer pooling for now to resolve an issue on Windows of interference between incoming packets.

On Windows, concurrent multi-threaded processing of inbound UDP somehow allows different data input processing to interfere with each other.
Possibly the endpoint reference is being switched, though I don't yet know the mechanism.  Not seen on Mono.
Also resolveable by setting RecyclePackets = false or RecycleBaseUDPPackets = false in [PacketPool]
Or async_packet_handling = false in [ClientStack.LindenUDP]
For now, will simply disable this particular pooling though will revisit this issue.
In response to http://opensimulator.org/mantis/view.php?id=6468
0.7.5-pf-bulletsim
Justin Clark-Casey (justincc) 2012-12-19 01:51:30 +00:00
parent 235afebf03
commit ae67435146
1 changed files with 8 additions and 5 deletions

View File

@ -208,9 +208,12 @@ namespace OpenMetaverse
{
UDPPacketBuffer buf;
if (UsePools)
buf = Pool.GetObject();
else
// FIXME: Disabled for now as this causes issues with reused packet objects interfering with each other
// on Windows with m_asyncPacketHandling = true, though this has not been seen on Linux.
// Possibly some unexpected issue with fetching UDP data concurrently with multiple threads. Requires more investigation.
// if (UsePools)
// buf = Pool.GetObject();
// else
buf = new UDPPacketBuffer();
if (IsRunningInbound)
@ -291,8 +294,8 @@ namespace OpenMetaverse
catch (ObjectDisposedException) { }
finally
{
if (UsePools)
Pool.ReturnObject(buffer);
// if (UsePools)
// Pool.ReturnObject(buffer);
// Synchronous mode waits until the packet callback completes
// before starting the receive to fetch another packet