This repository was archived by the owner on Nov 6, 2020. It is now read-only.
Fix _cannot recursively call into Core_ issue#10144
Merged
Merged
Conversation
This was referenced Jan 10, 2019
Contributor
Author
niklasad1
reviewed
Jan 11, 2019
| Ok(gateway_result) => gateway_result, | ||
| }; | ||
| match gateway_result { | ||
| Err(ref err) => debug!("Gateway search error: {}", err), |
Collaborator
There was a problem hiding this comment.
why not
match search_gateway_child.join().ok()? {
Err(e) => {}
Ok(g) => {}
}
Collaborator
|
@ngotchac I have seen this when I enable a lot of logs but I don't understand how the logs apply to this? Or do you think it is something else? |
Contributor
Author
|
@niklasad1 I think it's just a race-condition, so enabling logs might just slow down some parts of the start-up and raise this issue. |
niklasad1
approved these changes
Jan 11, 2019
sorpaas
approved these changes
Jan 11, 2019
Collaborator
sorpaas
left a comment
There was a problem hiding this comment.
LGTM. We only call it at startup so starting a thread shouldn't be bad.
5chdn
pushed a commit
that referenced
this pull request
Jan 12, 2019
5chdn
pushed a commit
that referenced
this pull request
Jan 12, 2019
5chdn
added a commit
that referenced
this pull request
Jan 15, 2019
* version: bump stable to 2.2.7 * version: mark 2.2 track stable * version: mark update critical on all networks * version: commit cargo lock * Ping nodes from discovery (#10167) * snap: fix path in script (#10157) * snap: fix path in script * debug, revert me * fix * necromancer awk magic * awk necromancy and path fixing * working track selection * Fix _cannot recursively call into `Core`_ issue (#10144) * Change igd to github:maufl/rust-igd * Run `igd::search_gateway_from_timeout` from own thread * Handle the case for contract creation on an empty but exist account with storage items (#10065) * Add is_base_storage_root_unchanged * Fix compile, use a shortcut for check, and remove ignored tests * Add a warn! * Update ethereum/tests to v6.0.0-beta.2 * grumble: use {:#x} instead of 0x{:x} Co-Authored-By: sorpaas <accounts@that.world> * version: bump fork blocks for kovan and foundation (#10186) * pull constantinople on ethereum network (#10189) * ethcore: pull constantinople on ethereum network * version: mark update as critical * ethcore: remove constantinople alltogether from chain spec * version: revert fork block for ethereum
5chdn
added a commit
that referenced
this pull request
Jan 15, 2019
* version: mark 2.3 track beta * version: mark update critical on all networks * Ping nodes from discovery (#10167) * Fix _cannot recursively call into `Core`_ issue (#10144) * Change igd to github:maufl/rust-igd * Run `igd::search_gateway_from_timeout` from own thread * Handle the case for contract creation on an empty but exist account with storage items (#10065) * Add is_base_storage_root_unchanged * Fix compile, use a shortcut for check, and remove ignored tests * Add a warn! * Update ethereum/tests to v6.0.0-beta.2 * grumble: use {:#x} instead of 0x{:x} Co-Authored-By: sorpaas <accounts@that.world> * version: bump fork blocks for kovan and foundation (#10186) * pull constantinople on ethereum network (#10189) * ethcore: pull constantinople on ethereum network * version: mark update as critical * ethcore: remove constantinople alltogether from chain spec * version: revert fork block for ethereum
5chdn
pushed a commit
that referenced
this pull request
Jan 22, 2019
5chdn
added a commit
that referenced
this pull request
Jan 22, 2019
* version: bump beta to 2.3.1 * Fix _cannot recursively call into `Core`_ issue (#10144) * Change igd to github:maufl/rust-igd * Run `igd::search_gateway_from_timeout` from own thread * Update for Android cross-compilation. (#10180) * build-unix update * .gitlab-ci update * Update build-unix.sh add android postprocessing * path to android lib libparity.so * fix path to libparity * add android lib to artifacts * Run all `igd` methods in its own thread (#10195) * Cancel Constantinople HF on POA Core (#10198) * Add EIP-1283 disable transition (#10214) * Enable St-Peters-Fork ("Constantinople Fix") (#10223) * ethcore: disable eip-1283 on kovan block 10255201 * ethcore: disable eip-1283 on ropsten block 4939394 * ethcore: enable st-peters-fork on mainnet block 7280000 * ethcore: fix kovan chain spec * version: update fork blocks * ethcore: disable eip-1283 on sokol block 7026400
ordian
added a commit
that referenced
this pull request
Mar 4, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It seems that on latest
master, Parity would sometimes crash withThread 'IO Worker #2' panicked at 'cannot recursively call into "Core"', libcore/option.rs:1008.This is because we use
https://github.com/sbstp/rust-igdmethodsearch_gateway_from_timeoutwhich callsget_control_urlwhich runs a future in a new tokio Core, while we call this method already from a running tokio Core.https://github.com/sbstp/rust-igd/blob/df53f419eec3684eec4bf0f45003cff1c4933682/src/search.rs#L101-L105
Moving to this fork and branch https://github.com/maufl/rust-igd/tree/update-hyper solves the issue ; maybe we should have our own fork?Instead of using another fork, I found that the easiest way to fix this is actually to run
igd::search_gateway_from_timeoutin a separate thread, where we are sure tokio won't be already running.To test that this work, one can apply this diff patch:
The inherant issue is that
future::loop_fnfirst calls the closure, so if the message to runinit_public_interface(which callsigd::search_gateway_from_timeout) is already in the queue when setting up the workers, it would run just fine sincetokio::runtime::current_thread::block_on_allhasn't been called yet ; this happens in most cases since it's the first message sent to the IoService. It could happen that it isn't, resulting ininit_public_interfacebeing called in a Tokio context, crashingparity-ethereum.With this patch, the first call to the future's closure won't wait for a message, resulting in every message being called in a Tokio context. So if one applies this patch on
master, it should crash the app at every single run.