-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Weird non-blocking block when using two nested tokio::spawn statements #703
Comments
Are you able to post the full code, including externs and use statements? |
|
That is all the code I need to reproduce this... ahm, happening (not sure if bug). Also, if relevant, rustc 1.29.0 |
Sorry, figured out what was wrong, I was essentially using Seems silly in hindsight, my apologies. |
Version 0.1.11
Platform Linux 4.18.9-arch1-1-ARCH #1 SMP PREEMPT Wed Sep 19 21:19:17 UTC 2018 x86_64 GNU/Linux
Description
I'm trying to write a tokio tcp listener in a rather straight forward manner:
My expectation with this code would be to be able to do something like:
echo whatever | netcat localhost 5282
and get back the messageHello world
However, what happens, is that I send a string of characters via
netact
or viatelent
and get nothing...The execution is "stuck" at the point in the code I marked with @1. The loop is not blocked, since I'm well able to send another request and have it reach the @1 point, but it seems like the task
tokio::spawn(reader)
is not actually getting spawned.Even weirder, when I close the connection I actually get the error that I'm printing out at the
@ Err
mark in the code.This behavior is rather weird. Am I doing something (obviously) wrong here or is this a bug/unexpected behavior of some sort ?
I mean... I am not blocking the event loop and I'm seemingly not "waiting" for anything, so why wouldn't the server progress to spawning the writer future before the connection is closed ?
The text was updated successfully, but these errors were encountered: