POETSII / Orchestrator

The Orchestrator is the configuration and run-time management system for POETS platforms.
1 stars 1 forks source link

Devices with a single output pin fail to send on softswitch_addresses #126

Closed heliosfa closed 4 years ago

heliosfa commented 4 years ago

Creating an issue as debugging is getting rather complex.

Where an XML has a device type with a single output pin, e.g. the spammer type in netstress_1mailbox_broken.xml.txt, instances of that device fail to send any messages.

Creating a dummy output pin, e.g. as in netstress_1mailbox.xml.txt, that is not connected to anything allows instances of the device to send but results in issue #125.

Adding some debugging to softswitch_common,cpp, it I can see that the ReadytoSend handler is being called and is taking the correct branch to return a send flag for the pin. However, the OnSend handler for the pin is never being called.

heliosfa commented 4 years ago

This issue was caused by how I implemented the circular buffer used for the RTS list. Essentially, when the RTS buffer has a single position, the variables that indicate the start and end indices are always equal. To determine whether there is something to send, the start and end indicies are compared -if they do not match, there is something to send. If they match, it is assumed that there is nothing to send. This was done for efficiency reasons (e.g. to avoid having another counter to manage or flag to check).

The solution was to modify P_builder to set this buffer to have a minimum size.