Comments (5)
Comment by ktoso
Wednesday Jun 29, 2016 at 21:25 GMT
Please read this response which explains what you're doing to the server here: http://stackoverflow.com/questions/34641861/akka-http-blocking-in-a-future-blocks-the-server/34645097#34645097
Put a warning in the routing docs not to do this
I agree we should give more guidance, where should we put those docs you think?
Dealing with futures is as simple as *don't block!", and there's the onComplete(future)
directive.
Create a 'strict' Directive which does this for you properly (See also #20096)
I like the idea, can you create a ticket specifically for it? Maybe even contribute? It would be rather simple :-)
Fix the code so that this is easily diagnosable/doesn't break
That is hard... I wonder if possible hm.
from akka-http.
Comment by Joe-Edwards
Tuesday Jul 05, 2016 at 09:51 GMT
where should we put those docs you think?
Perhaps a warning box at the bottom of the introduction to http://doc.akka.io/docs/akka/2.4.7/scala/http/routing-dsl/routes.html#routes ?
can you create a ticket specifically for it?
Done. I'll think about making some pull requests, but I need to sort out the CLA first.
from akka-http.
Comment by ktoso
Tuesday Jul 05, 2016 at 12:32 GMT
Perhaps a warning box at the bottom of the introduction to http://doc.akka.io/docs/akka/2.4.7/scala/http/routing-dsl/routes.html#routes ?
the Await block is scary. Yes, a note is likely a good idea, we could link from it to: akka/akka#20469 (which I'll attempt to merge).
Done. I'll think about making some pull requests, but I need to sort out the CLA first.
That'd be awesome :) Let me know if there's anything I could help out with there.
from akka-http.
Given there's an extractStrictEntity
directive now, is there any more work required for this ticket?
from akka-http.
Doing some (almost) spring cleaning. Let's close this for now.
Blocking in Akka will lead to bad results in any case. It would be nice if we could offer better tools to troubleshoot situations like this but at least in this case you can get an indication of what is wrong by looking at the stack trace which will show the blocking await call. A better solution is out of scope for Akka HTTP. Maybe at some point we can offer some diagnostics in Akka or Akka Stream directly.
from akka-http.
Related Issues (20)
- failed: CachingDirectivesSpec HOT 1
- Failed: Http2PersistentClientTlsSpec - when the first connection fails to materialize
- failed: TimeoutDirectivesExamplesSpec - should be configurable in routing layer despite infinite initial value of request-timeout
- fail: Http2ServerSpec - The Http/2 server implementation should support stream for request entity data
- User-Agent fails to parse Facebook in App string HOT 4
- host-connection-pool.min-connections property with positive value HOT 1
- Internal server error triggered by “Accept-Charset” header with unexpected value HOT 4
- Not possible to load project in IntelliJ 2023.2.1 HOT 1
- Duplicated 100 responses if there is an exception thrown by the unmarshaller HOT 1
- Several HTTP/2 client settings are never used anywhere
- failed: RouteDirectivesSpec -> should allow easy handling of futured ToResponseMarshallers
- Cannot Unmarshall Seq[String] Outside HOT 1
- Release 10.6.0-M1
- Release 10.6.0-M2
- CVE-2023-44487 HOT 3
- Release 10.5.3
- Release 10.6.0
- Failed: Http2ClientSpec should send RST_STREAM if entity stream is canceled HOT 2
- Failed: Http2ServerSpec send RST_STREAM if entity stream is canceled
- Remove dependency on `sbt-dependency-graph` 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 akka-http.