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

Update hyper to 0.12 #298

Closed
c0gent opened this issue Aug 7, 2018 · 8 comments
Closed

Update hyper to 0.12 #298

c0gent opened this issue Aug 7, 2018 · 8 comments

Comments

@c0gent
Copy link
Contributor

c0gent commented Aug 7, 2018

I see that this PR has been sitting for a while. I'd like to make the changes necessary to update hyper. I want to remove the rest of tokio-core from Parity due to its deprecation (migrate to tokio) and I'll need to update the reactor Handle to do that.

Is there anything in particular I should to be concerned about? Has anyone else looked into this?

@tomusdrw
Copy link
Contributor

tomusdrw commented Aug 8, 2018

Thanks for jumping on it, I started the migration some time ago (just pushed td-hyper branch), there is some work involved in changing the way we handle headers (hyper removed the typed headers), but everything should be doable.

@c0gent
Copy link
Contributor Author

c0gent commented Aug 8, 2018

Yep, I'm already about half way through it. I'll have a look at that branch. Thanks :)

@c0gent
Copy link
Contributor Author

c0gent commented Aug 9, 2018

Is there any particular reason to keep the RpcEventLoop single threaded (i.e. using a single Tokio Reactor all by itself) in the Spawned configuration? It's usually sub-optimal except maybe in micro-benchmarks and other special cases.

This may be something you guys have tested already and maybe there is some particular reason you want to stay single threaded. If that's the case I can make sure that all jsonrpc tasks stay that way without much trouble. I'll be removing the CpuPool from Parity and its reactor will be paired with a thread pool automatically so when RpcEventLoop is in the Shared configuration tasks will be running on a thread pool anyway (unless jsonrpc needs special treatment).

Otherwise I'll proceed with converting it to the standard tokio configuration (using a Runtime i.e. multi-threaded).

@tomusdrw
Copy link
Contributor

We wanted to have a handle that closes the server when dropped. And to simplify spawning a new server if you don't really care that much for async/tokio stuff.

It's fine to convert it to Runtime, I can review the changes even if unfinished if you are unsure about the approach.

@c0gent
Copy link
Contributor Author

c0gent commented Aug 10, 2018

So far the only API change I was planning to make is simply renaming server_utils::reactor::Remote to Executor. I'm not sure about that though. It's ability to close the server, etc. remains unchanged. I might rename the reactor module. No functionality anywhere will be removed or significantly changed.

You can see the changes on this branch. So far, I've mostly finished changes to the server-utils and tcp crates. tcp provides the best example of what will change (virtually nothing from the outside). I got slowed down working on ipc due to the changes I had to make to tokio-named-pipes and parity-tokio-ipc but the changes to ipc and http, etc. will be mostly along the same lines as those in tcp. A fairly straightforward migration.

@c0gent
Copy link
Contributor Author

c0gent commented Aug 14, 2018

Just an update: I haven't had time to work on this since last week and I have some travel coming up soon but I'm pretty much down to the final pieces and I'll do my best to get a PR submitted within in the next few days.

@jackcmay
Copy link

Is this still in motion?

@c0gent
Copy link
Contributor Author

c0gent commented Sep 24, 2018

PR is here: #303

Integrating similar changes into Parity (to properly test the changes made by #303) is largely blocked by: openethereum/parity-ethereum#9533

A WIP branch for those changes is: https://github.com/poanetwork/parity-ethereum/tree/c0gent-tokio

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants