Comments (4)
Agreed that for a canceled context we should return context.Canceled
. For context.DeadlineExceeded
this might lead to ambiguities. Assuming that the sender's mux isn't abnormally blocked, failing to write to s.transfers
would indicate that the peer doesn't have any credit, so I don't think we want to paper over that.
from go-amqp.
failing to write to s.transfers would indicate that the peer doesn't have any credit, so I don't think we want to paper over that.
if this is a legitimate case, you would still want to fail matching the deadline provided on the context.
not block indefinitely there. At which point do you return an error that knows for sure that it's because the peer doesn't have any credit? it should know that before the deadline, And return an appropriate error. but if you do reach the deadline, it should always be correct to return DeadlineExceeded.
from go-amqp.
We won't block indefinitely if there's no credit. We'll return an *amqp.Error
instead of a context.DeadlineExceeded
error.
You bring up a good point about knowing ahead of time if there's enough credit. I'll take a look at that.
from go-amqp.
Thinking about this more. The lack of credit should be temporal. So, I'm hesitant to just outright fail the transfer as that could be racy (i.e. the flow frame is in flight with credit, we just haven't received/processed it yet).
There is a bit of ambiguity though. There are two places where the sender waits on ctx.Done()
. The one we're discussing here and waiting for message settlement. Is it important to be able to distinguish between the two cases? i.e. in the former (no credit), should apps retry sending the message? Should they retry sending if we cancel/time out waiting for message settlement?
Maybe I'm overthinking all of this and just returning ctx.Err()
is good enough.
from go-amqp.
Related Issues (20)
- Support sharing session HOT 4
- Support sending message with text format only HOT 3
- Test: fake.NetConn.Write() will block until a response has been sent HOT 1
- is it possible to add my own Properties in message ApplicationProperties without "applicationProperties." prefix in properties' keys message? HOT 2
- Error sending to queue HOT 15
- Question: Possibility to use the fake Queue as a user of the library? HOT 2
- Question: Reconnect / retry mechanism HOT 2
- OpenTelemetry tracing
- Sender's delivery count and link credit can be out of sync on a failed transfer HOT 1
- Enhance mux hooks HOT 1
- Investigate new test failures
- Closing sender/receiver hangs HOT 3
- Missing serial number arithmetic HOT 1
- Default message priority should be 4, not 0 HOT 1
- memory leak HOT 1
- Expose bytes sent / bytes received
- Can Receiver.unsettledMessages be a count? HOT 1
- Artemis, anycast routing, queues w/o random id HOT 8
- `GetData()` only returns the first data segment HOT 2
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 go-amqp.