Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abort is not implemented #3

Open
NickMRamirez opened this issue May 13, 2020 · 4 comments
Open

Abort is not implemented #3

NickMRamirez opened this issue May 13, 2020 · 4 comments

Comments

@NickMRamirez
Copy link
Contributor

The SPOE specification defines an "Abort" flag on the metadata field as:

ABORT: Indicates that the processing of the current frame must be
           cancelled. This bit should be set on frames with a fragmented
           payload. It can be ignore for frames with an unfragemnted
           payload. When it is set, the FIN bit must also be set.

This is not yet implemented in this library.

cortex93 pushed a commit to cortex93/haproxy-spoa-dotnet that referenced this issue May 19, 2020
cortex93 pushed a commit to cortex93/haproxy-spoa-dotnet that referenced this issue May 19, 2020
@cortex93
Copy link

Spec is not clear if both HaProxy and Agent can send Abort.

If Haproxy send a abort frame, the current fragmented buffer should be discard.

Current HandleStream implementation cannot be stopped. If it were possible, i think of two possibles cases before sending Disconnect frame (again not clear in the spec) :

  • Agent should send abort frame for any existing fragments in the catalog, to tell Haproxy that frame being sent to the agent will not be processed.
  • If agent was sending a fragmented frame, it may send an abort frame, to tell Haproxy that it will not send the complete frame.

SetVariable data type are synchronous, if the binary one was read from a stream while sending the fragment frame and the stream failed, agent may send an abort frame.

Do you have a better understanding of the spec and possible evolution ?

NickMRamirez added a commit that referenced this issue May 28, 2020
@NickMRamirez
Copy link
Contributor Author

I agree, the spec is not clear about whether an agent can send an Abort. It only shows an example of a Notify frame from HAProxy aborting, so I think that's all that can be implemented for now. I have accepted your pull request, thanks!

@NickMRamirez
Copy link
Contributor Author

Looking at the spec again, there is an example of the agent aborting incoming fragments from HAProxy:

* Aborted fragmentation of a NOTIFY frame:

    HAPROXY                       AGENT SRV
       |            ...              |
       |       UNSET (frag X)        |
       | --------------------------> |
       |                             |
       |         ACK/ABORT           |
       | <-------------------------- |
       |                             |
       |       UNSET (frag X+1)      |
       | -----------X                |
       |                             |
       |                             |

I think this could happen if the agent code "cancels" the stream. This might be implemented as a side effect of cancelling the stream (related to #2) if there are unprocessed UNSET frames and the FIN flag has not been received yet.

@NickMRamirez
Copy link
Contributor Author

NickMRamirez commented Jul 10, 2020

It looks like the agent should send an ACK frame with the ABORT flag set to tell HAProxy that the agent wants to stop receiving UNSET frames when the payload is fragmented. I suppose the user would determine when to do this, and would need a function that sets this in motion, possibly a delegate that's passed into HandleStream, where some logic is checked to know whether to abort.

It might even be beneficial to leave this unimplemented until someone with a real use case chimes in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants