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

utils/prometheus: Make crate spawn onto global executor #6

Closed
wants to merge 20 commits into from

Conversation

mxinden
Copy link

@mxinden mxinden commented Jan 23, 2020

With 6ee1244 the Substrate green threading executor is now
configurable. The Substrate Prometheus crate can use this executor to
spawn futures per connection (scrape request).

Everything other than the last commit (ea9278a) can be ignored as it just merges current Substrate master.

tomaka and others added 20 commits January 20, 2020 12:57
* keep nominations after getting kicked with zero slash

* rename next_key to maybe_next_key

Co-Authored-By: Gavin Wood <gavin@parity.io>

Co-authored-by: Gavin Wood <github@gavwood.com>
* deprecate chain_status field of network handshake

* Update client/network/src/protocol/message.rs

remove unneeded whitespace.

Co-Authored-By: Pierre Krieger <pierre.krieger1708@gmail.com>

Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
* ci: increase retention for logs of tests to 144 hours

* change to days
* Initial work

* Fix most things

* fix test

* fix old comment

* migration

* fix

* remove useless stuff

* fix

* less spaghetti implementation

* fix initial session

* fix
Some fixes after: paritytech#4502

This removes the unwanted `expect`s from `MultiSigner`. Instead we
convert from full to compressed in `TryFrom` and can return an error on
invalid input.
* Make debug builds more usable

This pr makes debug builds more usable in terms of `cargo run -- --dev`.

1. `--dev` activates `--execution native`, iff `--execution` is not
given or no sub `--execution-*` is given.
2. It was probably a mistake to compile WASM in debug for a debug build.
So, we now build the WASM binary always as `release` (if not requested
differently by the user). So, we trade compilation time for a better
debug experience.

* Make sure we only overwrite default values

* Make it work

* Apply suggestion
* Pass an executor through the Configuration

* Make tasks_executor mandatory

* Fix tests
* contracts: during execution -> contract trapped during execution

This message confused many people so we are improving it to make clear what happened.

* contracts: rename Event::Contract -> Event::ContractExecution

* contracts: fix tests after ContractExecution renaming

* contracts: Add Evicted and Restored events

* fix doc comment

* wrap to not go over (soft) 100 column line limit

* add event deposit for eventual eviction upon pay_rent

* contracts: adjust tests for the new events

* emit Evicted event immediately and add tombstone flag bool
* Support `u128`/`i128` in runtime interface

This implements support for `u128`/`i128` as parameters/return value in
runtime interfaces. As we can not pass them as identity, as for the
other primitives types, we pass them as an pointer to an `[u8; 16]` array.

* Remove some unsafe code usage
…4706)

* client/authority-discovery/Cargo.toml: Update dependency

* client/authority-discovery: Pass packet payload and addresses as slice

Starting with Bytes 0.5 `Vec<T>` does not implement `Buf`, but `&[T]`
does.
* remove and reformat

* remove some more

* commit Cargo.lock
With 6ee1244 the Substrate green threading executor is now
configurable. The Substrate Prometheus crate can use this executor to
spawn futures per connection (scrape request).
@expenses
Copy link

Looks good. Not a blocking change, but does it work if you change the task executor to:

config.tasks_executor = {
	Some(Box::new(move |fut| { async_std::task::spawn(fut); }))
};

?

@nodebreaker0-0
Copy link
Owner

nodebreaker0-0 commented Jan 24, 2020

I don't understand deeply how global-executor behavior should be written in substrate.
I will follow your choice.

@mxinden
Copy link
Author

mxinden commented Jan 28, 2020

Closing here for now, given that I am not sure how to progress:

  • We can use the global executor, but once the user configures it to be async-std hyper will panic, given that it is not compatible by default.

  • We could spawn a separate Tokio runtime on a new thread.

  • We could keep it as is, which has much in common to the approach above, except that we would use async-std.

@mxinden mxinden closed this Jan 28, 2020
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

Successfully merging this pull request may close these issues.