bogomips.org dead, see unicorn-pub...@yhbt.net

2020-01-25 Thread Eric Wong
This is only intended for https://mail-archive.com/unicorn-public@bogomips.org readers to ensure they get continuity to https://yhbt.net/unicorn-public/ and https://mail-archive.com/unicorn-public@yhbt.net

gperf and no-kgio-wip branches stalled

2019-12-19 Thread Eric Wong
I haven't heard any feedback regarding the "gperf" changes, and I don't think the extra installation overhead of the gperf command is worth the overhead since most people will never notice it the improvement. https://bogomips.org/unicorn-public/20190704220108.7849-...@80x24.org/ I also started a

Re: Traffic priority with Unicorn

2019-12-16 Thread Eric Wong
Bertrand Paquet wrote: > Hello, > > I would like to introduce some traffic priority in Unicorn. The goal > is to keep critical endpoints online even if the application is > slowing down a lot. > > The idea is to classify the request at nginx level (by vhost, http > path, header or whatever),

[PUSHED] doc: replace pandoc-"Markdown" with real manpages

2019-12-14 Thread Eric Wong
Patch is unfortunately gigantic from whitespace changes, but you can view/download it here and every other mirror. https://bogomips.org/unicorn.git/commit/?id=d9b5943af26d5df5f49ab5cbf9731597c6ca85df Subject: doc: replace pandoc-"Markdown" with real manpages Trying to install pandoc on an x86-64

[PATCH] test_util: get rid of some unused variables in tests

2019-12-14 Thread Eric Wong
Ruby 2.7.0dev warns on them --- test/unit/test_util.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unit/test_util.rb b/test/unit/test_util.rb index 9d5d4ef..4a820ea 100644 --- a/test/unit/test_util.rb +++ b/test/unit/test_util.rb @@ -114,7 +114,7 @@ def test_pipe

Re: tmpio.rb and taint mode

2019-12-11 Thread Eric Wong
Terry Scheingeld wrote: > tmpio.rb causes an "insecure operation" error when being run in taint > mode. This is due not to a problem in tmpio.rb but in Ruby's File > class. Here are the details on the problem and a simple workaround for > it. > > I filed this bug report in February 2018: >

Re: Question about shared directory

2019-08-06 Thread Eric Wong
Patryk Kotarski wrote: > Hello, dear unicorn devs, > > Quick question which I failed to find in previous issues on > your archive and through search engines. Thanks for checking, first :> > Is there any specific reason for which many guides online > suggest saving the “unicorn.sock” file into

[PATCH 4/3] http: gperf 3.0.3 compatibility

2019-07-05 Thread Eric Wong
gperf actually used to use offsetof in older versions: https://git.savannah.gnu.org/cgit/gperf.git/commit?h=b468e3aae05d176d So we don't need to do that substitution for versions before that commit in gperf. Now why do we care about gperf 3.0.3 from 2007? That's because FreeBSD is stuck on

[PATCH 1/3] unit benchmark for our HTTP parser

2019-07-04 Thread Eric Wong
Some changes coming to the HTTP parser, so might as well throw some sort of benchmark we can work with to validate improvements. --- test/benchmark/http_parser.rb | 43 +++ 1 file changed, 43 insertions(+) create mode 100644 test/benchmark/http_parser.rb diff

[PATCH 3/3] http: memoize more common fields

2019-07-04 Thread Eric Wong
"DNT" is common, nowadays. "Forwarded" is... *shrug* It's an RFC, at least. "Origin" is a CORS, and something I've seen. I've seen "Upgrade-Insecure-Requests", "X-Forwarded-Host", "X-Request-ID", and "X-Requested-With" in the wild, too; so add those. --- ext/unicorn_http/common_fields.gperf | 10

[PATCH 0/3] http: use gperf for common field memoization

2019-07-04 Thread Eric Wong
I've been using gperf in other places, so I figured I might as well make HTTP parsing a teeny bit faster and allow us to avoid generating more garbage up front. Eric Wong (3): unit benchmark for our HTTP parser http: use gperf for common fields optimization http: memoize more common fields

[PATCH] examples/unicorn@.service: note the NonBlocking flag

2019-07-03 Thread Eric Wong
It's racy otherwise when starting simultaneous instanced units. Without specifying NonBlocking=true, systemd will clear the O_NONBLOCK flag every time it starts a new service instance. There's a small window where systemd can clear O_NONBLOCK immediately after it's set by Ruby (or kgio):

yet-another-horribly-named-server as an nginx alternative

2019-05-25 Thread Eric Wong
First off, it should come as no surprise to anybody nowadays that I hate marketing :P I also hate that anybody using unicorn is also stuck with nginx as the only (well-known) proxy which fully buffers both requests AND responses. One of the major reasons I like *nix-like is interchangeable

[PATCH 1/3] test/benchmark/ddstream: demo for slowly reading clients

2019-05-12 Thread Eric Wong
This is intended to demonstrate how badly we suck at dealing with slow clients. It can help users evaluate alternative fully-buffering reverse proxies, because nginx should not be the only option. Update the benchmark README while we're at it --- test/benchmark/README | 13 +++---

[PATCH 0/3] slow clients and test/benchmark tools

2019-05-12 Thread Eric Wong
Slowloris made waves nearly a decade ago, and there are still people being misled into using the wrong reverse proxy for unicorn. Maybe these new standalone Rack apps can convince folks to deploy unicorn correctly behind nginx, or better, evaluate alternatives to nginx :> Thus ddstream and

[PATCH] doc: stop advertising mailing list subscription

2019-04-15 Thread Eric Wong
It's still available, but no point in advertising something which increases the dependency on a centralized subscriber list. Subscription will never be required to write to our centralization-resistant public inbox (which anybody can read/mirror using HTTP(S) or NNTP). The mailing list has only

[PATCH] unicorn_rails: fix regression with Rails >= 3.x in app build

2019-03-06 Thread Eric Wong
ls <= 2.x projects in the old days. Fixes: 5985dd50a9bd7238 ("Support default_middleware configuration option") From: Jeremy Evans cf. https://bogomips.org/unicorn-public/20190306055734.GC61406@jeremyevans.local/ Signed-off-by: Eric Wong [ew: commit message] --- bin/unicorn_ra

Re: Issues after 5.5.0 upgrade

2019-03-05 Thread Eric Wong
Stan Pitucha wrote: > > I only saw one issue (proposed fix below). > Sorry, I solved the other one while writing the email but forgot to > update the intro. > > So the fix worked for the issue I mentioned, thanks! Also, running > unicorn directly works just fine now. You're welcome and thanks

Re: Issues after 5.5.0 upgrade

2019-03-05 Thread Eric Wong
Stan Pitucha wrote: > Hi, I'm running into two issues after an upgrade from 5.4.1 (a few I only saw one issue (proposed fix below). Did you forget to write about the other? > previous versions worked just fine as well). I've got a rails 5.2 app > started via: > > bin/unicorn_rails -E

Re: Release 5.5.0?

2019-03-03 Thread Eric Wong
Jeremy Evans wrote: > It's been a couple of months since the 5.5.0 preview release. Other the > the change to use rb_gc_register_mark_object, there haven't been any > changes since. I know you don't have much time for Ruby currently, but > would it be possible for you to release 5.5.0 in the

Re: Bug#918916: Unicorn not reporting proper version for gemfile?

2019-01-10 Thread Eric Wong
(unicorn upstream here, adding unicorn-public to Cc, for context: ) Dominik George wrote: > +--- a/unicorn.gemspec > b/unicorn.gemspec > +@@ -11,7 +11,7 @@ end.compact > + > + Gem::Specification.new do |s| > + s.name = %q{unicorn} > +- s.version =

Re: what Ruby versions and how many CPU cores/threads are you using?

2018-12-30 Thread Eric Wong
Sam Saffron wrote: > Quick data point from Discourse. We use raindrops quite a lot for basic > graphing of processing/queued connection counts. Shifting to Ruby 2.3+ > would pose no problem to us, we already deploy our main application on 2.5. > > With raindrops we use it for graphing queued and

[PATCH] Links: add historical mongrel dev list mirror

2018-12-28 Thread Eric Wong
unicorn has no future, but at least some of our past is archived. This was taken from nntp://news.gmane.org/gmane.comp.lang.ruby.mongrel.devel as the HTTP parts of gmane are dead. Unfortunately, Gmane only started archiving mongrel-developm...@rubyforge.org in 2008 and discussions prior to that

[ANN] unicorn 5.5.0.pre1 - Rack HTTP server for fast clients and Unix

2018-12-20 Thread Eric Wong
orn-public/20180913192449.GE48926@jeremyevans.local/ There's also a couple of uninteresting minor optimizations and documentation additions. Eric Wong (10): remove random seed reset atfork use IO#wait instead of kgio_wait_readable Merge branch '5.4-stable' shrink pipes u

[PATCH] README: minor updates and additional disclaimer

2018-12-18 Thread Eric Wong
Nowadays, I mainly rely on systemd (and not USR2) for zero-downtime upgrades. Also, CoW-friendliness is standard in mainline Ruby since 2.0. There also needs to be a disclaimer to point out the unfortunate side-effect of robustness for hosting buggy apps. --- README | 11 +-- 1 file

[PATCH] doc/ISSUES: add links to git clone-able mail archives of our dependencies

2018-12-12 Thread Eric Wong
Archives are crucial to preserving history and knowledge in Free Software projects, so promote them for projects we depend on. Naq lrf, gur nepuviny fbsgjner qrirybcrq sbe nepuvivat gur havpbea znvyvat yvfg unf ybat fhecnffrq gur hfrshyarff bs havpbea vgfrys :C --- ISSUES | 7 +-- 1 file

Re: [RFC] deduplicate strings VM-wide in Ruby 2.5+

2018-12-06 Thread Eric Wong
Since 'mkmf' is already in the fstring table as that exists in the source; so I'll at least have to squash this on top for Ruby <=2.5: diff --git a/ext/unicorn_http/extconf.rb b/ext/unicorn_http/extconf.rb index 5b7a8ca..d5f81fb 100644 --- a/ext/unicorn_http/extconf.rb +++

[RFC] deduplicate strings VM-wide in Ruby 2.5+

2018-12-06 Thread Eric Wong
String#-@ deduplicates strings starting with Ruby 2.5.0 Hash#[]= deduplicates strings starting in Ruby 2.6.0-rc1 This allows us to save a small amount of memory by sharing objects with other parts of the stack (e.g. Rack). --- RFC because I've only lightly-tested this and only with Ruby

[PATCH] doc: update more URLs to use HTTPS and avoid redirects

2018-11-07 Thread Eric Wong
Latency from redirects is painful, and HTTPS can protect privacy in some cases. --- .olddoc.yml | 2 +- Application_Timeouts | 8 Documentation/unicorn.1.txt | 2 +- Documentation/unicorn_rails.1.txt | 2 +- LICENSE |

Re: Support default_middleware configurator method

2018-09-23 Thread Eric Wong
Jeremy Evans wrote: > Sorry about both of those issues and for the delay in responding to > this. No worries, I haven't been around much, either. > I've included your changes in the following squashed commit, > which also includes an integration test for the default_middleware > configuration

Re: Support default_middleware configurator method

2018-09-14 Thread Eric Wong
Jeremy Evans wrote: > On 09/13 10:34, Eric Wong wrote: > > Worse case is we only support default_middleware as a config > > option (but I prefer not to add more options). Embedded -N support > > is an anti-feature which leads to lock-in. > > I don't really care ab

Re: Make Worker#user support different process primary group and log file group

2018-09-13 Thread Eric Wong
Jeremy Evans wrote: > This patch allows Worker#user to accept the group argument as an array > of two strings, the first string being the process primary group, and > the second string being the group that owns the log files. This can > help when you have a large number of applications that use

Re: Support default_middleware configurator method

2018-09-13 Thread Eric Wong
Jeremy Evans wrote: > I was originally looking for a way to turn off default middleware > without having to specify the -N command line option every time. > After reading the Unicorn.builder code, I thought it may be > possible to do this by specifying the option as an embedded option > in the

[PATCH] socket_helper: add hint for FreeBSD users for accf_http(9)

2018-08-20 Thread Eric Wong
Because I forget to load accf_http on new FreeBSD installs, too :x --- lib/unicorn/socket_helper.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/unicorn/socket_helper.rb b/lib/unicorn/socket_helper.rb index b540302..8a6f6ee 100644 --- a/lib/unicorn/socket_helper.rb +++

[PATCH] shrink pipes under Linux

2018-08-20 Thread Eric Wong
We have never had any need for pipes with the default 64K capacity on Linux. Our pipes are only used for tiny writes in signal handlers and to perform parent shutdown detection. With the current /proc/sys/fs/pipe-user-pages-soft default, only 1024 pipes can be created by an unprivileged user

Re: KGIO issues under WSL

2018-08-13 Thread Eric Wong
Sam Saffron wrote: > Howdy, > > For some crazy reason we really want to run Unicorn on Windows > Subsytem for Linux. We only use Unicorn in production and some of our > devs like using WSL for "crazy reasons TM". > > I guess the on-boarding is somewhat easier for Windows users vs > spinning up

[ANN] unicorn 5.4.1 - Rack HTTP server for fast clients and Unix

2018-07-23 Thread Eric Wong
-inbox.org/inbox.comp.lang.ruby.unicorn Changes: unicorn 5.4.1 This release quiets some warnings for Ruby 2.6 preview releases and enables tests to pass under Ruby 1.9.3. Otherwise, nothing interesting for Ruby 2.0..2.5 users. *YAWN* Eric Wong (1): quiet some

[PATCH] use IO#wait instead of kgio_wait_readable

2018-06-01 Thread Eric Wong
Slowly reducing dependencies on kgio. 'io/wait' is required by 'socket' these days, so it's no extra relocations for .so loading, either. --- lib/unicorn.rb | 1 + lib/unicorn/http_server.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/unicorn.rb

[PATCH] remove random seed reset atfork

2018-05-30 Thread Eric Wong
It's not unicorn 6, yet, but we dropped Ruby 1.8 support at unicorn 5. Stable Ruby 1.9+ releases have always reseeded the PRNG at fork. --- lib/unicorn/http_server.rb | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/unicorn/http_server.rb b/lib/unicorn/http_server.rb index

Re: [PATCH] Send SIGTERM before SIGKILL on timeout

2018-02-24 Thread Eric Wong
Fumiaki MATSUSHIMA wrote: > To output log / send error to error tracking service, > we need to receive a signal other than SIGKILL first. > --- > Hi Unicorn team, > > I'm not sure this change is accetable though, > I can find some articles and patches to prevent SIGKILL > on

Re: [PATCH] Use IO#wait instead to fix test for Ruby 1.9

2018-02-24 Thread Eric Wong
Fumiaki MATSUSHIMA wrote: > IO#wait_readable is introduced since 2.0 > > I confirmed we can pass tests for all versions of Ruby with this patch. Thanks, applied. Not sure if it's worth making a new release to fix a test case, so I might wait a bit and see if there's other

Re: Log URL with murder_lazy_workers

2018-01-14 Thread Eric Wong
Sam Saffron wrote: > I would love to start logging the actual URL that timed out when > murder_lazy_workers does its thing. > > Clearly the master process has no knowledge here, but perhaps if we > had a named pipe from each child to master we could quickly post > current

[PATCH] ISSUES: add a note about Debian BTS interopability

2017-12-23 Thread Eric Wong
This isn't anything new, just explicitly stating what's always been the case. In other news, I hate formal things. --- ISSUES | 5 + 1 file changed, 5 insertions(+) diff --git a/ISSUES b/ISSUES index 10df4d6..610f011 100644 --- a/ISSUES +++ b/ISSUES @@ -15,6 +15,11 @@ submit patches and/or

[PATCH] tests: cleanup some unused variable warnings

2017-12-21 Thread Eric Wong
Add a new "check-warnings" target to the GNUmakefile to make checking for this easier. Warnings aren't fatal, and newer versions of Ruby tend to increase warnings. --- GNUmakefile | 5 + test/unit/test_droplet.rb | 2 +- test/unit/test_request.rb | 20 ++-- 3

[PATCH] avoid reusing env on hijack

2017-12-15 Thread Eric Wong
Eric Wong <e...@80x24.org> wrote: > Btw, did you get a chance to look at my patch? (I haven't :x) Thanks for testing (privately confirmed). I've added a test case and pushed the following out to unicorn.git https://bogomips.org/unicorn.git/patch?id=30e3c6abe542c6a9f5955e1d65896a0c3b

Re: env reuse and hijack

2017-12-04 Thread Eric Wong
Eric Wong <e...@80x24.org> wrote: > Totally untested; but maybe the patch below works for you > by replacing the buf and env objects in the hijacked cases. > > Can you try it and report back? Thanks. Btw, did you get a chance to look at my patch? (I haven't :x) -- unsubscri

Re: Auto scaling workers with unicorn

2017-12-04 Thread Eric Wong
Sam Saffron wrote: > I would like to amend Discourse so we "automatically" absorb certain > traffic spikes. As it stands we can only configure unicorn with > num_workers and use TTIN and TTOUT to tune the number on the fly. > > I was wondering if you would be open to

[PATCH] require 'pp' if $DEBUG is set by Rack app

2017-11-16 Thread Eric Wong
While "unicorn -d" requires 'pp' when setting $DEBUG, we did not account for (rare) Rack applications setting $DEBUG at load time. Thanks-to: James P (Jim) Robinson Jr --- lib/unicorn.rb | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git

Re: [PATCH] fix GC issue on rb_global_variable array

2017-10-03 Thread Eric Wong
Xuanzhong Wei wrote: > diff --git a/ext/unicorn_http/unicorn_http.rl > b/ext/unicorn_http/unicorn_http.rl > index 6fc3498..357440b 100644 > --- a/ext/unicorn_http/unicorn_http.rl > +++ b/ext/unicorn_http/unicorn_http.rl > @@ -921,6 +921,7 @@ void Init_unicorn_http(void) >

Re: Bug, probably related to Unicoen

2017-09-14 Thread Eric Wong
Felix Yasnopolski wrote: > We use Ruby v2.2.3, Rails v4.2.4, Unicorn v5.1.0 in production. > > ActiveRecord validation rules and callbacks for all models of app has > been disabled after unicorn restart (from log rotation script). Here > it is Wow, that's a new

Re: Random crash when sending USR2 + QUIT signals to Unicorn process

2017-08-07 Thread Eric Wong
Jeremy Evans <c...@jeremyevans.net> wrote: > On 07/24 01:25, Eric Wong wrote: > > Jeremy Evans <c...@jeremyevans.net> wrote: > > > Running with GC.stress didn't catch the error for me. But I'm using a > > > fairly old compiler (GCC 4.2.1, the OpenBSD d

Re: Random crash when sending USR2 + QUIT signals to Unicorn process

2017-07-23 Thread Eric Wong
Jeremy Evans wrote: > Running with GC.stress didn't catch the error for me. But I'm using a > fairly old compiler (GCC 4.2.1, the OpenBSD default), so this may be > something that only shows up on a newer compiler that does more > optimizations. Pere: just curious if

Re: Random crash when sending USR2 + QUIT signals to Unicorn process

2017-07-14 Thread Eric Wong
Jeremy Evans wrote: > All of Sequel's postgres adapter tests still pass with this, so I merged > this into the master branch. I'll do some more testing of my apps, but > unless I run into problems I plan to release this as sequel_pg 1.7.1 > early next week. Thanks for the

Re: Random crash when sending USR2 + QUIT signals to Unicorn process

2017-07-14 Thread Eric Wong
Jeremy Evans wrote: > Thanks for this patch. I'm not an RB_GC_GUARD expert, but the changes > look fine to me. The existing RB_GC_GUARD calls were added by me in > 2012 to fix an earlier segfault.[1] This is the first reported > RB_GC_GUARD-related segfault in sequel_pg

Re: Random crash when sending USR2 + QUIT signals to Unicorn process

2017-07-14 Thread Eric Wong
Pere Joan Martorell wrote: > I suspect that the conflicting gem was 'sequel_pg' (sequel_pg > overwrites the inner loop of the Sequel postgres adapter row fetching > code with a C version. The C version is significantly faster than the > pure ruby version that Sequel uses

Re: Random crash when sending USR2 + QUIT signals to Unicorn process

2017-07-13 Thread Eric Wong
+Cc: Philip and Jonathan since they encountered this three years ago, but we never heard back from them: https://bogomips.org/unicorn-public/?q=T_NODE+d:..20170713 Pere Joan Martorell wrote: > >

[PATCH] reduce method calls with String#start_with?

2017-06-27 Thread Eric Wong
These three cold call sites instruction sequence size by a few hundred bytes combined since we no longer support Ruby 1.8.6. The "?/" shorthand is esoteric and no longer avoids allocation in Ruby 1.9+ (not that this is hot code). --- lib/unicorn/configurator.rb | 2 +- lib/unicorn/http_server.rb

mailing list header changes

2017-06-25 Thread Eric Wong
For anybody who's reading this through a mailing list subscription, it turns out I screwed up setting the List-Id: header back in 2014 and didn't read RFC 2919 :x https://public-inbox.org/meta/20170626030733.6069-...@80x24.org/ Before: List-Id: After:

nakayoshi_fork for CoW memory use reductions

2017-06-25 Thread Eric Wong
I thought I posted about when I first heard about it, but apparently not. It's a RubyGem which should help with CoW memory savings for Ruby 2.2+ due to the introduction of generational GC. https://rubygems.org/gems/nakayoshi_fork git clone

Re: Master Process Reaping Worker with No message

2017-05-23 Thread Eric Wong
Aakash Gupta wrote: > So, thanks a lot Eric :)  No problem! Thanks for following up after finding the solution. > I was finally able to solve this error because of the > direction and hint that you gave me. But the only thing that I > need to find is that what is

Re: Master Process Reaping Worker with No message

2017-05-23 Thread Eric Wong
Aakash Gupta wrote: > I am using unicorn server with Nginx for running my Rails app. > I don't know why but my master server is reaping workers > continously while file uploads. I have raised the timeout > limit of unicorn to 20 minutes for giving sufficient time for >

Re: after_worker_exit on murder

2017-04-05 Thread Eric Wong
Simon Eskildsen wrote: Thank you for your reply. It is a good reminder of how far away I am from the rest of the web development world :> > It becomes difficult, because sometimes you have legitimate requests > that take 10-20s, because the merchant's data set is

Re: [ANN] unicorn 5.3.0 - Rack HTTP server for fast clients and Unix

2017-04-01 Thread Eric Wong
Eric Wong <e...@80x24.org> wrote: > Anyways, this is a largish release with several new features, > and no backwards incompatibilities. Oops :x Just released Rainbows! 5.1.1 to fix one incompatibility introduced with unicorn 5.3.0 :x https://bogomips.org/rainbows-public/2017040202

[PATCH] test_exec: SO_KEEPALIVE value only needs to be true (take #2)

2017-03-27 Thread Eric Wong
We need to ensure the portability of the sd_listen_fds emulation test, too, which didn't get tested on my FreeBSD 10.3 install due to it being on Ruby 2.2 Followup-to: 4ce6b00f75f1 ("test_exec: SO_KEEPALIVE value only needs to be true") --- test/exec/test_exec.rb | 2 +- 1 file changed, 1

Re: Rack::Request#params EOFError

2017-03-26 Thread Eric Wong
gt; input stream? If so, this would break the Rack spec. I only tested > > this on Darwin, still working on a self-contained repro. Ping on this. Eric Wong <e...@80x24.org> wrote: > No, it should not raise EOFError unless a client sent less than > the Content-Length it

[PATCH] doc: note after_worker_exit is also 5.3.0+

2017-03-23 Thread Eric Wong
Followup-to: 650e01ab0b118803486b56f3ee59521d59042dae ("doc: add version annotations for new features") --- Oops, missed the 5.3.0.pre1 release; I managed to squash in the worker_exec change for that, though. lib/unicorn/configurator.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git

[ANN] unicorn 5.3.0.pre1 - Rack HTTP server for fast clients and Unix

2017-03-23 Thread Eric Wong
of these features. 34 changes since 5.2.0 (2016-10-31): Eric Wong (27): drop rb_str_set_len compatibility replacement TUNING: document THP caveat for Linux users tee_input: simplify condition for IO#write remove response_start_sent http_request: freeze constant strings

[PATCH] test_ccc: use a pipe to synchronize test

2017-03-22 Thread Eric Wong
Sleeping 1 second to test 100 requests is too long for some systems; and not long enough for others. We need to also finish reading the sleeper response to ensure the server actually got the second request in, before sending SIGQUIT to terminate it; as it's possible for the test client to connect

Re: mail queue breakage :x

2017-03-21 Thread Eric Wong
Eric Wong <e...@80x24.org> wrote: > Anyways, feel free to exit/run it yourself, with or without tor > and add mirrors and whatnot. And you can hammer the hell out Just be warned that attached validation script checks against deliveries to mail-archive.com; so no, don't ham

Re: mail queue breakage :x

2017-03-21 Thread Eric Wong
Maybe the attached script will help detect mirror mismatches in the future (run via cron). But of course the original mail failure was due to the crontab of the mlmmj user getting clobbered :x Anyways, feel free to exit/run it yourself, with or without tor and add mirrors and whatnot. And you

mail queue breakage :x

2017-03-21 Thread Eric Wong
Apologies for the flood of mail, apparently there was a lot of stuff backed up for a month which was getting archived but not delivered. Anyways NNTP and HTTPS archives have been working, and I forgot SMTP was still supposed to go out :x nntp://news.public-inbox.org/inbox.comp.lang.ruby.unicorn

Re: check_client_connection using getsockopt(2)

2017-03-21 Thread Eric Wong
Simon Eskildsen <simon.eskild...@shopify.com> wrote: > On Wed, Feb 22, 2017 at 8:42 PM, Eric Wong <e...@80x24.org> wrote: > > Simon Eskildsen <simon.eskild...@shopify.com> wrote: > >> I meant to ask, in Raindrops why do you use the netlink API to get the > &

Re: Patch: Add after_worker_exit configuration option

2017-03-21 Thread Eric Wong
Jeremy Evans <c...@jeremyevans.net> wrote: > On 02/21 07:43, Eric Wong wrote: > > Jeremy Evans <c...@jeremyevans.net> wrote: > > > This option can be used to implement custom behavior for handling > > > worker exits. For example, let's say you have a speci

[PATCH 2/3] revert signature change to HttpServer#process_client

2017-03-21 Thread Eric Wong
We can force kgio_tryaccept to return an internal class for TCP objects by subclassing Kgio::TCPServer. This avoids breakage in any unfortunate projects which depend on our undocumented internal APIs, such as gctools Cc: Aman Gupta ---

[PATCH] test-lib: expr(1) portability fix

2017-03-21 Thread Eric Wong
GNU expr supports '+' to match one or more occurrences, but it seems the expr(1) on my FreeBSD installation does not. --- This only covers the Bourne sh integration tests in t/ I still don't trust the Ruby language (and test libraries written in it) to not change incompatibility after all

Re: Patch: Add after_worker_ready configuration option

2017-03-21 Thread Eric Wong
Jeremy Evans <c...@jeremyevans.net> wrote: acknowledging everything above. > On 02/23 02:32, Eric Wong wrote: > > Jeremy Evans <c...@jeremyevans.net> wrote: > > Anyways, I'm somewhat inclined to accept this as well, but will > > think about it a bit,

Re: [PATCH] Add worker_exec configuration option

2017-03-21 Thread Eric Wong
Jeremy Evans wrote: > Thanks for your detailed review. I will work on an updated patch and > try to send it tomorrow or Friday. No problem and no rush; I might be out a bit the next few days. -- unsubscribe: unicorn-public+unsubscr...@bogomips.org archive:

Re: Patch: Add after_worker_ready configuration option

2017-03-21 Thread Eric Wong
Jeremy Evans wrote: > This adds a hook that is called after the application has > been loaded by the worker process, directly before it starts > accepting requests. This hook is necessary if your application > needs to get gain access to resources during initialization, >

[PATCH] oob_gc: rely on opt_aref_with optimization on Ruby 2.2+

2017-03-21 Thread Eric Wong
Maybe oob_gc probably isn't heavily used anymore, maybe some Ruby 2.2+ users will benefit from this constant reduction. Followup-to: fb2f10e1d7a72e67 ("reduce constants and optimize for Ruby 2.2") --- lib/unicorn/oob_gc.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git

Re: Patch: Add after_worker_exit configuration option

2017-03-21 Thread Eric Wong
Jeremy Evans wrote: > Here's a revised patch that should address the issues you identified: Thanks. Pushed as 2af91a1fef70d6546ee03760011c170a082db667 I needed one change to an integration test to workaround the lack of reader attribute, but I'd rather pay the cost in the

Re: [PATCH] Add worker_exec configuration option V2

2017-03-21 Thread Eric Wong
Jeremy Evans <c...@jeremyevans.net> wrote: > On 03/10 09:19, Eric Wong wrote: > > tests, later, or you can. I also had some FreeBSD test fixes > > (which might apply to OpenBSD) on a VM somewhere which I'll Cc: > > you on: there was also just SO_KEEPALIVE fix

Re: [PATCH] Add worker_exec configuration option V2

2017-03-21 Thread Eric Wong
Jeremy Evans wrote: > Here's a patch to fix the stack depth issue: Thanks, applied with some trailing whitespace fixups. (I suggest enabling the pre-commit hook distributed with git in $GIT_DIR/hooks/pre-commit, it'll run "git diff-index --check ..." to check that) >

Re: [PATCH] check_client_connection: use tcp state on linux

2017-03-21 Thread Eric Wong
Awesome! Thanks for the update. I'll merge ccc-tcp-v3 into master soon and push out 5.3.0-rc1 (Maybe there's need to quote at all, every message is archived forever in several public places: https://bogomips.org/unicorn-public/ https://www.mail-archive.com/unicorn-public@bogomips.org

[PATCH] t0011-active-unix-socket.sh: fix race condition in test

2017-03-21 Thread Eric Wong
Killing the master process may lead to the worker dying on its own (as designed); before kill(1) has had an opportunity to send the second kill(2) syscall on the worker process. Killing the worker before the master might also lead to a needless respawn, so merely kill the master and let the

[PATCH] unicorn_http: reduce rb_global_variable calls

2017-03-21 Thread Eric Wong
rb_global_variable registers the address of the variable which refers to the object, instead of the object itself. This adds extra overhead to each global variable for our case, where the variable is frozen and never changed. Given there are currently 59 elements in this array, this saves 58

Re: Patch: Add after_worker_exit configuration option

2017-03-21 Thread Eric Wong
Jeremy Evans wrote: > This option can be used to implement custom behavior for handling > worker exits. For example, let's say you have a specific request > that crashes a worker process, which you expect to be due to a > improperly programmed C extension. By modifying your

response_start_sent (check_client_connection) is staying

2017-02-15 Thread Eric Wong
There's no way I would remove this feature or any other feature other people rely on. Just pushed this out: commit c4b58719e8aa7f2b4979d139ca166a8c6a11eb7e Author: Eric Wong <e...@80x24.org> Date: Wed Feb 15 18:37:10 2017 + Revert "remove response_start_sent&quo

[PATCH] tee_input: simplify condition for IO#write

2017-02-10 Thread Eric Wong
IO#write already elides the write(2) syscall for empty buffers, so there's no need to complicate our instruction sequence footprint for the rare case of an empty buffer. The only cases a Rack app will have an empty buffer are: 1) `env['rack.input'].read` without args 2) `env['rack.input'].gets`

Re: WTF is up with memory usage nowadays?

2017-02-08 Thread Eric Wong
Eric Wong <e...@80x24.org> wrote: > The Rack response body only needs to respond to #each. > There should be no reason to build giant response > documents in memory before sending them to a client. > > unicorn can't do the following for you automatically since

[RFC] TUNING: document THP caveat for Linux users

2016-11-28 Thread Eric Wong
This probably applies to other kernels, too, but I'm most familiar with Linux. --- It took me a while to get the wording below to this point. Maybe there's not enough detail for folks unfamiliar with how OSes work, or maybe there's too much and will be TL;DR-ed... TUNING | 20

Re: Support for HTTP/1.0

2016-11-01 Thread Eric Wong
Joe McIlvain wrote: > We work on an IoT-oriented web service that uses Unicorn. One of our > requirements is to support HTTP/1.0 for low-complexity devices. > > We've noticed that HTTP/1.0 requests to Unicorn always get HTTP/1.1 > responses, which is invalid behaviour for

[ANN] unicorn 5.2.0 - Rack HTTP server for fast clients and *nix

2016-10-31 Thread Eric Wong
oat and speed up certificate renewals. There's also the usual round of documentation and example updates, too. Eric Wong (7): examples/init.sh: update to reduce upgrade raciness doc: systemd should only kill master in example examples/logrotate.conf: update exa

Re: trying to update unicorn to 5.1, build failure: VERSION= must be specified

2016-10-27 Thread Eric Wong
Hleb Valoshka <375...@gmail.com> wrote: > On 9/19/16, Pirate Praveen wrote: > > Its pushed to alioth. Can someone check? > > > > Error below: > > > > $ clean > > dh clean --buildsystem=ruby --with ruby,systemd > >dh_testdir -O--buildsystem=ruby > >dh_auto_clean

[PATCH] relocate website to https://bogomips.org/unicorn/

2016-10-25 Thread Eric Wong
HTTPS helps some with reader privacy and Let's Encrypt seems to be working well enough the past few months. This change will allow us to reduce subjectAltName bloat in our TLS certificate over time. It will also promote domain name agility to support mirrors or migrations to other domains

Re: [PATCH] Add some tolerance (RFC2616 sec. 19.3)

2016-10-20 Thread Eric Wong
Mishael A Sibiryakov wrote: > It's just a temporary fork and I'm too lazy )) > Whoops, my fault.  No worries :) > > > +  def test_multiline_header_0d0a > > > +parser = HttpParser.new > > > +parser.buf << "GET / HTTP/1.0\r\nX-Multiline-Header: foo > > > bar\r\n\tcha

Re: systemd with logs to journald

2016-09-09 Thread Eric Wong
Please don't drop the Cc: to unicorn-public@bogomips.org, other readers are following along. Bill Lipa wrote: > If I do that, the output goes nowhere, I assume because I'm using the > -D flag on the ExecStart: > ExecStart=/home/ops/bin/bundle exec "unicorn_rails -D -c >

Re: systemd with logs to journald

2016-09-09 Thread Eric Wong
Bill Lipa wrote: > Hello, > > Is there a recommended way to run unicorn under systemd and get its > stdout/err to go to journald rather than into a file on disk? I > prefer to minimize the number of places I have to look for errors. Remove the stdout_path and stderr_path

Re: Please join the Rack Specification discussion for `env['upgrade.websocket']`

2016-08-08 Thread Eric Wong
Sam Saffron wrote: > For the record Eric, > > We use unicorn at Discourse to serve concurrent long polls across 100s > of hosted forums using hijack with zero issues using > https://github.com/SamSaffron/message_bus Thanks. That's exactly the usage I had in mind when I

Re: Please join the Rack Specification discussion for `env['upgrade.websocket']`

2016-08-05 Thread Eric Wong
Boaz Segev wrote: > Running two (or more) event loops, each with it's own > resources, is wasteful and promotes needless context switches. > > There is no reason to hijack a socket when the server can > easily provide callbacks for IO related events using it's > existing

[PATCH] doc: update gmane URLs to point to our own archives

2016-07-28 Thread Eric Wong
Gmane's NNTP server remains up, but the HTTP site is down: https://lars.ingebrigtsen.no/2016/07/28/the-end-of-gmane/ Anyways, our own archives are designed to be mirror-able via git: git clone --mirror https://bogomips.org/unicorn-public And the code is self-hostable: git clone

  1   2   >