Skip to content
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

Remove dependency on tokio 0.1 #2945

Closed
19 of 47 tasks
lukesteensen opened this issue Jul 1, 2020 · 10 comments · Fixed by #3449
Closed
19 of 47 tasks

Remove dependency on tokio 0.1 #2945

lukesteensen opened this issue Jul 1, 2020 · 10 comments · Fixed by #3449
Assignees
Labels
type: tech debt A code change that does not add user value.

Comments

@lukesteensen
Copy link
Member

lukesteensen commented Jul 1, 2020

This is a prerequisite for removing tokio-compat and using some nice things like the #[tokio::test] macro.

First, we need to upgrade dependencies that rely on tokio 0.1 (some of these are in progress):

$ cargo tree -i -p tokio:0.1.22          
tokio v0.1.22                                                   
├── hyper v0.12.35                                              
│   ├── hyper-openssl v0.7.1                                    
│   │   └── shiplift v0.6.0                                     
│   │       └── vector v0.10.0 (/home/luke/code/vector)         
│   ├── hyper-tls v0.3.2                                        
│   │   └── reqwest v0.9.24                                     
│   │       └── vector v0.10.0 (/home/luke/code/vector)         
│   ├── hyperlocal v0.6.0                                       
│   │   └── shiplift v0.6.0 (*)                                 
│   ├── reqwest v0.9.24 (*)                                     
│   └── shiplift v0.6.0 (*)                                     
├── hyperlocal v0.6.0 (*)                                       
├── pulsar v0.3.0                                               
│   └── vector v0.10.0 (/home/luke/code/vector)                 
├── reqwest v0.9.24 (*)                                         
├── shiplift v0.6.0 (*)                                         
├── trust-dns-resolver v0.12.0                                  
│   └── pulsar v0.3.0 (*)                                       
└── vector v0.10.0 (/home/luke/code/vector)                     

Second, we need to remove tokio 0.1 types from our sources, sinks, and transforms. These consist mostly of timers and IO types like sockets that we should switch to the equivalent tokio 0.2 types. Where relevant and not too invasive, this can also be a good time to do some light updates away from futures 0.1 combinators and towards async/await. The following is a rough list of files that import tokio01:

This work should be very easy to work on in parallel, so feel free to grab a dependency or a specific file and go to work on a PR.

@lukesteensen lukesteensen added the type: tech debt A code change that does not add user value. label Jul 1, 2020
@lukesteensen lukesteensen added this to the Tech-Debt Payment #1: Move to Tokio 0.2/Futures 0.3 milestone Jul 1, 2020
@binarylogic
Copy link
Contributor

@kirillt @ktff would you mind putting your name by each file before you begin work? This will ensure there are no conflicts. I'm happy to split this out into separate issues if you think it'll be easier, but I think it'll add a significant amount of noise.

@fanatid
Copy link
Contributor

fanatid commented Jul 8, 2020

New dependency tree (ae53b88):

$ cargo tree -i -p tokio:0.1.22
tokio v0.1.22
├── pulsar v0.3.0
│   └── vector v0.10.0 (/home/kirill/projects/vector)
├── trust-dns-resolver v0.12.0
│   └── pulsar v0.3.0 (*)
└── vector v0.10.0 (/home/kirill/projects/vector)

After pulsar update (#2977) only vector will depend from tokio:0.1.22.

Edit: pulsar merged (https://github.com/timberio/vector/tree/ccbb802c010c6109240a14be44b3c30dbae73564):

$ cargo tree -i -p tokio:0.1.22
tokio v0.1.22
└── vector v0.10.0 (/home/kirill/projects/vector)

@fanatid
Copy link
Contributor

fanatid commented Jul 15, 2020

@ktff I'll start on updating codec, roughly this files will be affected:

$ grep 'codec::' -rl src/
src/sinks/statsd.rs
src/sinks/util/tcp.rs
src/sinks/util/unix.rs
src/test_util.rs
src/sources/vector.rs
src/sources/statsd/mod.rs
src/sources/http.rs
src/sources/syslog.rs
src/sources/socket/unix.rs
src/sources/socket/mod.rs
src/sources/util/tcp.rs
src/sources/util/unix.rs

@ktff
Copy link
Contributor

ktff commented Jul 19, 2020

@fanatid I'll start with src/shutdown.rs.

@ktff
Copy link
Contributor

ktff commented Jul 19, 2020

@fanatid I'll start with benches/http.rs

@binarylogic binarylogic modified the milestones: Tech-Debt Payment #1: Move to Tokio 0.2/Futures 0.3, 2020.07.19 - The Great Orientation Jul 20, 2020
@fanatid
Copy link
Contributor

fanatid commented Jul 21, 2020

@ktff I'll start work on updating MaybeTlsStream and related things (currently on top of #3095, will rebase when will be merged).

@fanatid
Copy link
Contributor

fanatid commented Jul 28, 2020

@ktff I'm going remove https://github.com/timberio/vector/blob/6a6c390b7e7af2b977ff088245e94e31cefb7640/src/stream.rs#L40 and update affected code.

@fanatid
Copy link
Contributor

fanatid commented Jul 28, 2020

@ktff looks like not a lot of tokio01 usage left, I do not think that it cost divide files, so I'll take rest.

@ktff
Copy link
Contributor

ktff commented Aug 13, 2020

@fanatid how is this going? Need any extra hands?

@fanatid
Copy link
Contributor

fanatid commented Aug 13, 2020

Need only update my previous TLS PR #3188 and we should be able remove tokio:0.1. Should finish soon, no need help right now I think. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: tech debt A code change that does not add user value.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants