Comments (6)
Reception of LEASE frame is equivalent to processing of LEASE frame for the protocol processing. As the lease enforcement is done by the protocol for the application, there is no queue delay issue nor any problem from propagation delay from the network. Time is relative to processing of the LEASE.
The LEASE is not a guarantee of processing. It is a "go ahead and try" mechanic. This is a distributed system and thus strict ordering must be externally imposed if desired. With the lease mechanic, it is not assumed nor required. Thus, it is possible for a request to be denied due to changing demands on the Responder side. An ERROR is necessary for load shedding even with a LEASE mechanic and must be handled by the application logic above the protocol.
Granting 1 million requests for 24 hours then changing its mind 2 seconds later is fine. It's probably not advisable, though. A better strategy would be a slow start mechanic or a deli counter ticketing mechanic.
This would minimize the amount of shed load and help ease a thundering herd scenario.
The spec states that request liveness is the application concern. So, the app should handle the possibilities of ERROR as well as RESPONSE (NEXT and COMPLETE, etc.) as it sees fit so all those semantics are up to the app. Does it care or not is the first question.
What specific functionality is desired for the app here? A responder can send ERROR (retry or not is application concern). It can send RESPONSE frames to indicate success (as in send the data). And the Responder has full control of sending LEASEs in a workable strategy to head off having to send too many ERRORs for shedding.
If something is missing, let us (@stevegury , @benjchristensen , and I) know what specifically is missing that would make it easier or better to handle.
from rsocket.
The rule when a responder receives a request frame that exceeds the LEASE it granted to the requester is to ignore the request. That means no ack of any sort is sent back to the requester.
This is like removing ACK from TCP and instead of TCP figuring out if a packet needs retransmission and the receiver figuring out if a packet is a duplicate and automatically doing all that, requiring the sending application using TCP decide what to do.
from rsocket.
Sorry, forgot to add timeout of request at the application level as a possibility. No matter what ReactiveSocket does, a request may never be fulfilled due to application logic (intentionally or not). So, a robust application should timeout a request that doesn't get "answered" within the time that it expects. If ReactiveSocket where to keep a "dead" request alive, that would be just as bad. The protocol implementation has no way to know what the app intended or if the app is even in a good state or not on a per request basis. Just as TCP has no idea either for applications using it.
@stevegury should we make it so that the wording for intended behavior for when a lease is exceeded it SHOULD send back an ERROR for this?
I get your point about lack of reliability for TCP and pushing it up to the application. But in this case, I think it actually is the applications job and it has control of the semantics. ReactiveSocket is just the transport, multiplexing, providing semantics for requests, back pressure, etc.
from rsocket.
should we make it so that the wording for intended behavior for when a lease is exceeded it SHOULD send back an ERROR for this?
I think of this lease as a "soft lease" i.e. the responder reserves the right of rejecting a request after lease expiry but may choose to respond if it has the resources to handle the request. As you mentioned that expecting strict alignment across time boundaries in a distributed systems is not the greatest thing to achieve :), specifically for this usecase. However, in the case where the server is really overloaded as it gave out exact leases, it may be prohibitive to actually send an error response. So, I don't think we should say that RS "SHOULD" send back an error.
from rsocket.
I think that @wmiaw correctly identified a problem here.
It will simplify the implementation if a server has to respond to message received out of a lease scope by an error.
That way, server control the lease window and the number of tickets given to a client, a client will always have an outdated view of that, but that's fine because servers MUST reply with an error if it receives a request "outside" of a lease.
This will also simplify thing like leases rebalancing, or draining (clients will receive an explicit error rather than relying on timeout).
I will update this in #25
from rsocket.
Spec now uses ERROR for request that can not be handled. Also, set of error codes for various use cases and range of error codes.
from rsocket.
Related Issues (20)
- [Release] Checklist HOT 7
- RSocket with Clients Mutiplatforms HOT 6
- Cannot dispose server HOT 2
- Fragmentation for METADATA_PUSH HOT 4
- NET::ERR_CERT_COMMON_NAME_INVALID HOT 6
- [Needs Clarification] Frame Size Limit
- Weaker frame ordering in Connection-Oriented communication HOT 24
- Dart/Flutter support. HOT 6
- Re-vice spec format to be aligned with RFC format
- The successor of websocket is being worked on HOT 5
- Jitter for KEEP ALIVE frames HOT 5
- RSocket has /will consider request-reponse as a default mode? HOT 2
- Signup link for community.reactive.foundation breaks on community.netifi.com redirect HOT 1
- Add Connection Setup frame to list of places where composite metadata can be applied
- Deploy rsocket-demo as demo.rsocket.io
- [Discussion] Does rsocket plan to be supported by cloud native components? HOT 3
- Propagate headers/metadata in RSocket HOT 1
- rsocket send duplicate requests (4) each "keepAlive" interval HOT 1
- Confusion on metadata length field
- MimeType of MESSAGE_RSOCKET_AUTHENTICATION does not work with JWTs HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rsocket.