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

feat: tokio upgrade #729

Merged
merged 29 commits into from
Aug 12, 2021
Merged

Conversation

Mirko-von-Leipzig
Copy link
Contributor

@Mirko-von-Leipzig Mirko-von-Leipzig commented Aug 2, 2021

Quite a large and difficult refactor. There are some issues remaining which require feedback.

  1. There is now a stack-overflow when running in debug mode. This is a bug in warp
  2. Two FIXME todo! I left for format to strings where I don't know what info is valuable.

Test status remained the same for me before and after. Tests can all pass; but the ilp-node tests seem plagued by racey start-up conditions (?) and sporadically fail -- this behaviour was the same before the refactor.

--edit--
Added a fix for (1) -- tests now pass in debug mode. We will want to ensure that other filter handlers are covered by tests, but that should be a new issue.

crates/ilp-node/Cargo.toml Outdated Show resolved Hide resolved
@koivunej
Copy link
Collaborator

koivunej commented Aug 2, 2021

There is now a stack-overflow when running in debug mode.

How come this didn't manifest itself in test-md build...? Surely it does a lot of filters. Did you add unconditional boxing to the filters and I missed it while doing the commit-per-commit?

@Mirko-von-Leipzig
Copy link
Contributor Author

Mirko-von-Leipzig commented Aug 2, 2021

There is now a stack-overflow when running in debug mode.

How come this didn't manifest itself in test-md build...? Surely it does a lot of filters. Did you add unconditional boxing to the filters and I missed it while doing the commit-per-commit?

I did try inserting .boxed on all the routes/filters I could find. But I never managed to "fix" the issue -- I presumed its because I didn't know where to look in the codebase. So its possible its a different issue; but its unlikely as:

  1. Release build works, Debug does not (as described in the issue)
  2. Using println debugging indicates that its when the warp serve gets called.

I'm not sure about test-md.

@Mirko-von-Leipzig
Copy link
Contributor Author

Mirko-von-Leipzig commented Aug 2, 2021

Force pushed to include fmt fixes

@Mirko-von-Leipzig
Copy link
Contributor Author

Rebase'd master changes (CI speed improvements)

@Mirko-von-Leipzig
Copy link
Contributor Author

Commit e72bd5c introduces a work-around fix for the warp stack-overflow bug (mentioned in PR description).

Further investigation indicates that no other stack-overflow issues remain (from this bug) -- used test coverage to check all instances of filters are covered or manually inspected if missed.

Copy link
Collaborator

@koivunej koivunej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oki with the stack overflow issues hopefully avoided. I forgot to give approval for this initially, so I guess we'll await until tomorrow before merging.

Signed-off-by: Mirko von Leipzig <[email protected]>
Required manually implementing Serialization for `Secret<String>` as
this is purposefully disabled by default.

Signed-off-by: Mirko von Leipzig <[email protected]>
Main API changes are `bytes()` to `chunks()` and similar renamings.

Signed-off-by: Mirko von Leipzig <[email protected]>
Does not compile, requires changes to many other dependencies as well.

Main API change is `delay_for` to `sleep`.

Signed-off-by: Mirko von Leipzig <[email protected]>
`DelayQueue` was moved from `tokio` to `tokio-util` in preparation
for the 1.0 release of `tokio`.

Signed-off-by: Mirko von Leipzig <[email protected]>
This fixes the missing `Stream` adapters for `tokio` related items.

For example, `tokio::sync::Receiver<T>` used to implement `FutureExt`
trait, but it no longer does. Instead we now wrap it using
`tokio-stream` to provide the same extension.

Signed-off-by: Mirko von Leipzig <[email protected]>
Signed-off-by: Mirko von Leipzig <[email protected]>
Signed-off-by: Mirko von Leipzig <[email protected]>
Signed-off-by: Mirko von Leipzig <[email protected]>
Signed-off-by: Mirko von Leipzig <[email protected]>
Signed-off-by: Mirko von Leipzig <[email protected]>
Note that version "0.3.15" was yanked.

Signed-off-by: Mirko von Leipzig <[email protected]>
Signed-off-by: Mirko von Leipzig <[email protected]>
Signed-off-by: Mirko von Leipzig <[email protected]>
Also includes removing the base tungstenite dependency. Since
tokio-tungstenite re-exports it.

Signed-off-by: Mirko von Leipzig <[email protected]>
Previous version was yanked.

Changes are
- `Domain::ipv4()` -> `Domain::IPV4`
- `Type::stream()` -> `Type::STREAM`
- `socket.into_tcp_listener()` -> `TcpListener::from(socket)`

Signed-off-by: Mirko von Leipzig <[email protected]>
Signed-off-by: Mirko von Leipzig <[email protected]>
futures-retry API changes:
- `#attempts` is now tracked by the library
- retry output changed: `Result<output, err>` to
`Result<(output, attempts), (err, attempts)>`

Signed-off-by: Mirko von Leipzig <[email protected]>
Maximum retries were being passed in to the RequestErrorHandler as is.
However in RequestErrorHandler it is defined as maximum attempts.

i.e. `N > max` versus `N == max`

In the future-retries upgrade the check for this was corrected to match
the attempts naming, but this broke the actual usage which assumed it
was retries.

Signed-off-by: Mirko von Leipzig <[email protected]>
Signed-off-by: Mirko von Leipzig <[email protected]>
Fix for stack-overflow in debug mode, caused by too many warp filters.
Issue link: seanmonstar/warp#811

Signed-off-by: Mirko von Leipzig <[email protected]>
Was a tokio 0.2 dependency, no longer needed.

Signed-off-by: Mirko von Leipzig <[email protected]>
The error handler is rarely / never configured for tests, and this error
was therefore not visible.

Signed-off-by: Mirko von Leipzig <[email protected]>
Part of upgrading tokio from v0.2 to v1.*.

Signed-off-by: Mirko von Leipzig <[email protected]>
Patched for versions >=0.14.10, and we now use 0.14.11.

Signed-off-by: Mirko von Leipzig <[email protected]>
Patched in versions >=0.6.3, we use 0.6.4.

Signed-off-by: Mirko von Leipzig <[email protected]>
This now matches the version used by our dependencies, so that we
only depend on one version overall.

Signed-off-by: Mirko von Leipzig <[email protected]>
This matches the version used by warp, and means we only depend on
a single version. The downgrade doesn't remove any functionality we
rely on.

Signed-off-by: Mirko von Leipzig <[email protected]>
@koivunej
Copy link
Collaborator

Allrighty, this is ready to merge. This a big step forwards, thanks a lot!

@koivunej koivunej merged commit 9013c94 into interledger:master Aug 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants