Comments (3)
Checking for deadline is not very cheap. Checking it before each socket operation could degrade performance quite a lot.
Are you describing a theoretical problem or the current behavior does harm in some practical case?
from userver.
or the current behavior does harm in some practical case?
Well, depends on what one would consider 'harmful', but i would argue that the current behavior it not consistent with other parts of the framework: i as developer strongly expect a function that takes deadline as a parameter to be a 'deadline-point', which takes the burden of checking a deadline from me.
Are you describing a theoretical problem ...
Mostly, but i remember being surprised by this when testing clickhouse driver.
Say you have following logic (in pseudocode):
void SendUntilDeadline(deadline) {
while (true) {
some_data = GenerateSomeData();
socket.SendSome(some_data, deadline);
}
}
One could assume that this function stops execution when deadline is reached, but it might go well beyond if receiving side can keep up
I understand that checking deadline before each socket operation is costly, but what's your opinion on checking deadline once as early as possible, before going into while (io_func)
loop?
from userver.
@apolukhin bump
from userver.
Related Issues (20)
- gRPC server hangs during shutdown with active bidirectional stream RPC HOT 1
- Possible change of log level for Postgres connection ping
- Implement reflection-based automatic JSON parsing/serialization HOT 4
- Implement caching component for MySQL database backend
- [postgres] make connlimit-mode auto ttl dynamic
- use lld by default if clang is used HOT 1
- remove MONGO_DEADLINE_PROPAGATION_ENABLED_V2
- [json] parse depth limit HOT 2
- Add LRU caches for Multi Index Map
- Usage of CA cert on server side
- macos build error
- Impossible to change binary dir for userver subdirectory HOT 1
- Can't link with develop branch if C++20 enabled HOT 7
- Support request for close from websocket client HOT 1
- libmongoc might use blocking usleep call on worker TaskProcessor HOT 3
- Add support converting from Protobuf message to Domain Entity
- Option to generate proto-files on project rebuild HOT 1
- Mongoc library version mismatch HOT 4
- bug: implicit-const-int-float-conversion
- Unit testing framework: ability to complete pending Sleep() on mocked time advance
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 userver.