Commit Graph

16599 Commits

Author SHA1 Message Date
Cory Fields
c98b91b7c5 httpserver: explicitly detach worker threads
When using std::thread in place of boost::thread, letting the threads destruct
results in a std::terminate. According to the docs, the same thing should be
be happening in later boost versions:
http://www.boost.org/doc/libs/1_55_0/doc/html/thread/thread_management.html#thread.thread_management.thread.destructor

I'm unsure why this hasn't blown up already, but explicitly detaching can't
hurt.

Zcash: cherry-picked from commit d3773ca9aeb0d2f12dc0c5a0726778050c8cb455
This fixes #2554 (zcash-cli stop during getblocktemplate long poll
causes 'Assertion `!pthread_mutex_unlock(&m)' failed.')
2017-08-01 20:24:27 +01:00
Wladimir J. van der Laan
c7f77e28f0 http: speed up shutdown
This continues/fixes #6719.

`event_base_loopbreak` was not doing what I expected it to, at least in
libevent 2.0.21.
What I expected was that it sets a timeout, given that no other pending
events it would exit in N seconds. However, what it does was delay the
event loop exit with 10 seconds, even if nothing is pending.

Solve it in a different way: give the event loop thread time to exit
out of itself, and if it doesn't, send loopbreak.

This speeds up the RPC tests a lot, each exit incurred a 10 second
overhead, with this change there should be no shutdown overhead in the
common case and up to two seconds if the event loop is blocking.

As a bonus this breaks dependency on boost::thread_group, as the HTTP
server minds its own offspring.

Zcash: cherry-picked from commit a264c32e3321ae909ca59cb8ce8bf5d812dbc4e1
2017-08-01 20:24:27 +01:00
Wladimir J. van der Laan
2abe8ef721 http: Force-exit event loop after predefined time
This makes sure that the event loop eventually terminates, even if an
event (like an open timeout, or a hanging connection) happens to be
holding it up.

Zcash: cherry-picked from commit ec908d5f7aa9ad7e3487018e06a24cb6449cc58b
2017-08-01 20:24:27 +01:00
Wladimir J. van der Laan
dbf7057f7a http: Wait for worker threads to exit
Add a WaitExit() call to http's WorkQueue to make it delete the work
queue only when all worker threads stopped.

This fixes a problem that was reproducable by pressing Ctrl-C during
AppInit2:
```
/usr/include/boost/thread/pthread/condition_variable_fwd.hpp:81: boost::condition_variable::~condition_variable(): Assertion `!ret' failed.
/usr/include/boost/thread/pthread/mutex.hpp:108: boost::mutex::~mutex(): Assertion `!posix::pthread_mutex_destroy(&m)' failed.
```

I was assuming that `threadGroup->join_all();` would always have been
called when entering the Shutdown(). However this is not the case in
bitcoind's AppInit2-non-zero-exit case "was left out intentionally
here".

Zcash: cherry-picked from commit de9de2de361ab1355b976f17371d73e36fe3bf56
Fixes #2334 and #2214.
2017-08-01 20:24:27 +01:00
Wladimir J. van der Laan
c0fe29370a Make HTTP server shutdown more graceful
Shutting down the HTTP server currently breaks off all current requests.
This can create a race condition with RPC `stop` command, where the calling
process never receives confirmation.

This change removes the listening sockets on shutdown so that no new
requests can come in, but no longer breaks off requests in progress.

Meant to fix bitcoin/#6717.

Zcash: cherry-picked from commit 5e0c22135600fe36811da3b78216efc61ba765fb
2017-08-01 20:24:27 +01:00
Ariel Gabizon
1ea4df6826 make-release.py: Updated release notes and changelog for 1.0.11-rc1. 2017-08-01 17:12:52 +02:00
Ariel Gabizon
dc5d6d5f5d make-release.py: Updated manpages for 1.0.11-rc1. 2017-08-01 17:12:50 +02:00
Ariel Gabizon
fcf824e9f1 make-release.py: Versioning changes for 1.0.11-rc1. 2017-08-01 17:11:57 +02:00
Jack Grigg
8ebb299d40 ci-workers: Enable pipelining, and use root to set admin and host details
Workarounds for Ansible issues when becoming an unprivileged user:
https://docs.ansible.com/ansible/become.html#becoming-an-unprivileged-user
2017-08-01 12:35:58 +01:00
Homu
10acd8a1fb Auto merge of #2484 - str4d:block-download-completion, r=daira
Add block download progress to metrics UI
2017-07-28 21:57:19 -07:00
Jack Grigg
92bfde0edf Improve network height estimation 2017-07-28 10:50:07 +00:00
Jack Grigg
4a651837be Correct and extend EstimateNetHeightInner tests
Corrections are to the median block times, which were generated by subtracting
CBlockIndex::nMedianTimeSpan / 2 from the block height and then multiplying by
the target spacing. GetMedianTimePast() takes an array sorted by std::sort() and
returns element CBlockIndex::nMedianTimeSpan / 2, meaning that if
CBlockIndex::nMedianTimeSpan is odd (which it is), there is an out-by-one error
in the subtraction.
2017-07-28 10:45:44 +00:00
Homu
d6e6f51724 Auto merge of #2526 - bitcartel:2480_segfault_zeroconf_from_zaddr, r=daira
Fixes #2480 where missing map entry would cause a segfault.

`wtxHeight = mapBlockIndex[wtx.hashBlock]->nHeight;` results in undefined behaviour when the block hash is not present in the map, returning a null value which is dereferenced via `->nHeight`.  This error is triggered by a zero-conf wallet transaction which has not been mined yet.  As discussed in #2480, on some systems there is a segfault whilst on others there is a silent exit.  This makes it difficult to write a test, but the fix has been tested empirically to confirm an exception is thrown.  This PR fixes the segfault and complements #2525 which prevents a user from sending from a zaddr with minconf 0.
2017-07-27 22:42:59 -07:00
Jack Grigg
047aec1e0e Add block download progress to metrics UI 2017-07-26 00:51:12 +00:00
Homu
e88ab1a920 Auto merge of #2529 - str4d:2444-rpc-www-authenticate, r=daira
[rpc] Add WWW-Authenticate header to 401 response

Fix cherry-picked from upstream PR bitcoin/bitcoin#7472.

Closes #2444.
2017-07-25 15:36:33 -07:00
Homu
eeac474228 Auto merge of #2543 - nathan-at-least:2499-specify-ci-worker-criteria, r=daira
Document our criteria for adding CI workers.

This is a doc improvement that came out of #2499.
2017-07-25 14:16:22 -07:00
Daira Hopwood
75401530d7 Document our criteria for adding CI workers. closes #2499
Author: Nathan Wilcox <nathan@z.cash>
Author: Daira Hopwood <daira@jacaranda.org>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2017-07-25 21:27:16 +01:00
Homu
a698116b28 Auto merge of #2478 - bitcartel:2477_send_alert_1.0.10, r=daira
Alert for 2017-06-23.a degraded networking (fixed in 1.0.10-1)

Alert 1004 (version 1.0.10 only) Issue #2477
2017-07-25 13:03:53 -07:00
jl777
ade1a82564 Merge pull request #452 from Shmuma/master
Debian package for komodo
2017-07-23 16:55:10 +02:00
Max Lapan
9069e4addf Debian package for komodo
1. tweaks in control file (name, url, git, etc)
2. package script
3. changelog
2017-07-23 16:34:31 +02:00
Homu
95d18784ec Auto merge of #2525 - bitcartel:2519_no_zero_minconf_from_zaddr_zsendmany, r=daira
When sending from a zaddr, minconf cannot be zero.

Closes #2519.
2017-07-20 08:24:54 -07:00
Bjorn Hjortsberg
ecd04e914f Remove deprecated exception specification
Warns on a newer compiler that these are deprecated in C++11
2017-07-20 13:58:39 +02:00
Bjorn Hjortsberg
4272a1e2b1 Do not warn on built in declaration mismatch 2017-07-20 13:27:37 +02:00
jl777
43d805dc0c Merge pull request #451 from jl777/dev
JUMBLR
2017-07-18 08:46:33 +02:00
Homu
d2627bc65d Auto merge of #2504 - daira:2501.remove-upnp, r=daira
Remove UPnP support. fixes #2500

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2017-07-16 03:43:54 -07:00
jl777
5101611f24 Test 2017-07-15 12:05:04 +02:00
jl777
4bfb533b13 Test 2017-07-15 11:24:57 +02:00
Homu
d3a976095f Auto merge of #2509 - str4d:ci-workers, r=str4d
Ansible playbook for configuring CI workers

The playbook in this PR can be used for configuring common Unix variants to run a Buildbot worker for the Zcash CI, starting from a fresh install (or a VM template provided by a hosting service).
2017-07-14 19:10:21 -07:00
Homu
1738e6957f Auto merge of #2458 - daira:2450.pyflakes-cleanup, r=str4d
pyflakes cleanup

Make the RPC tests pyflakes-clean. fixes #2450

Includes a fix that upstream had in https://github.com/bitcoin/bitcoin/pull/7802
2017-07-14 18:03:03 -07:00
Jack Grigg
e0c696a1e7 Add pyflakes to required Python modules
See #2494 for details.
2017-07-14 12:35:10 -05:00
Jack Grigg
e5f8e6185a Add a separate Buildbot host info template for EC2
Latent workers are not usually created on the instance type that will be used,
so memory and CPU info collected at AMI creation will likely be inaccurate.
2017-07-14 12:35:09 -05:00
Jack Grigg
8247fd954c Remove Buildbot version from host file
Buildbot master already obtains and publishes this in the UI.
2017-07-14 12:34:40 -05:00
Jack Grigg
3ba809b6d7 Add pyblake2 to required Python modules
See #2533 for details.
2017-07-14 12:34:40 -05:00
Jack Grigg
64363d1351 Add steps for setting up a latent worker on Amazon EC2 2017-07-14 12:34:37 -05:00
Jack Grigg
6ff5a13497 Add Buildbot worker setup to Ansible playbook
Currently assumes the host uses systemd
2017-07-14 12:33:55 -05:00
Homu
098e8139c5 Auto merge of #2535 - daira:zcash-is-experimental-wording, r=daira
Change wording in Security Warnings section of README.md.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2017-07-14 08:52:25 -07:00
jl777
88de65bead Test 2017-07-14 10:26:03 +02:00
jl777
fd9256e865 Test 2017-07-14 10:25:23 +02:00
jl777
ae85ad79db Test 2017-07-14 10:22:19 +02:00
Simon
9b5da42745 Fixes #2480. Null entry in map was dereferenced leading to a segfault. 2017-07-14 00:10:54 -07:00
Daira Hopwood
52ca5aac5b Change wording in Security Warnings section of README.md.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2017-07-14 05:18:08 +01:00
jl777
a039c62d97 Test 2017-07-14 00:16:20 +02:00
jl777
78408e6beb Test 2017-07-13 23:41:02 +02:00
jl777
90da8c911f Test 2017-07-13 23:26:20 +02:00
jl777
db53f4bfe2 Test 2017-07-13 23:01:17 +02:00
jl777
6ba30dbb3f Test 2017-07-13 22:46:55 +02:00
jl777
4fa92f993a Test 2017-07-13 22:34:18 +02:00
jl777
233f077b2a Test 2017-07-13 22:33:03 +02:00
jl777
ceb639e0e8 Test 2017-07-13 22:32:19 +02:00
jl777
a99362fad8 Test 2017-07-13 22:17:33 +02:00