RevProxy Problems #60

Closed
mdaguete opened this Issue Jun 3, 2011 · 9 comments

Comments

Projects
None yet
3 participants
Contributor

mdaguete commented Jun 3, 2011

Hello,

I've been using yaws embedded with revproxy from a long time, after upgrading to 1.90 (HEAD too) from 1.85 revproxy blocks yaws after a few requests.

You can clone the test case from git://github.com/mdaguete/Yaws_test.git

compile with make, run with make console

Eshell V5.8.3 (abort with ^G)
1> application:start(yt).
ok

3> yt_test:test_embedded().
test [1]: {ok,"404"}
test [2]: {ok,"404"}
test [3]: {error,req_timedout}

Thank You.

Collaborator

vinoski commented Jun 5, 2011

Thanks, I'll take a look.

@ghost ghost assigned vinoski Jun 5, 2011

Ummon commented Jun 14, 2011

Same problem here but without using the embedded mode. It works with 1.88 but crashes with 1.90.

Collaborator

vinoski commented Jun 15, 2011

I built and ran the Yaws_test submitted as explained in the first comment above and got the following results:

6> yt_test:test_embedded().
test [1]: {ok,"404"}
test [2]: {ok,"404"}
test [3]: {ok,"404"}
test [4]: {ok,"404"}
test [5]: {ok,"404"}
test [6]: {ok,"404"}
test [7]: {ok,"404"}
test [8]: {ok,"404"}
test [9]: {ok,"404"}
test [10]: {ok,"404"}
[{ok,"404"},
 {ok,"404"},
 {ok,"404"},
 {ok,"404"},
 {ok,"404"},
 {ok,"404"},
 {ok,"404"},
 {ok,"404"},
 {ok,"404"},
 {ok,"404"}]

I assume this is what you expected to see?

I see you're using rebar for your build. Unfortunately rebar currently has some problems when yaws is used as a dependency — I'm working with the rebar guys to try to resolve these. Any chance you could build your code using make, or at least the yaws part of it, and try again?

Contributor

mdaguete commented Jun 15, 2011

The results you obtained are the expected, as the revproxy is configured in yt.erl with
{revproxy,[
{"/revtest",
#url{scheme="http",
host="127.0.0.1",
port=80}}
]}
and ibrowse tries to access "http://localhost:8000/revtest/index.html.

I've compiled yaws with make and the problem appears again.

Collaborator

vinoski commented Jun 15, 2011

I guess this will make debugging more difficult. :-(

Contributor

mdaguete commented Jun 15, 2011

Steve, do you have a web server listening on 127.0.0.1:80 ?

When I was trying to debug the error my apache was stopped and all seemed to work.

After change revproxy config in yt.erl to

                 {revproxy,[
                            {"/revtest",
                             #url{scheme="http",
                                  host="209.85.229.99", %% Google address
                                  port=80}}
                           ]}
                ],

the bug appears again.

3> yt_test:test_embedded().
test [1]: {ok,"200"}
test [2]: {ok,"200"}
test [3]: {error,req_timedout}
test [4]: {error,req_timedout}
test [5]: {error,req_timedout}
test [6]: {error,req_timedout}
test [7]: {error,req_timedout}
test [8]: {error,req_timedout}

I've pushed a patch to github.

Sorry for my mistake.

Regards.

Collaborator

vinoski commented Jun 17, 2011

OK, duplicated the problem. Will start figuring it out now.

vinoski added a commit that referenced this issue Jun 21, 2011

fix reverse proxy problem (issue #60)
Change yaws_server.erl to not exit on {'EXIT', From, Reason} messages
found when erasing transient messages, a change originally introduced
in commit c075573. Doing so was causing reverse proxy to no longer
work, as reported in issue #60 on github and as experienced by several
users. Note however that this might be a temporary fix, since it might
be better to figure out the source of the EXIT message, but I'm
committing and pushing this fix now for the benefit of those waiting
to use the reverse proxy feature.

Thanks to Manuel Durán Aguete for providing a test case making it easy
to reproduce the problem and test the fix.
Collaborator

vinoski commented Jun 21, 2011

I've pushed a fix for this, please give it a try.

vinoski added a commit that referenced this issue Jun 21, 2011

catch exit signals sent by gserv process
In commit 5cc39b7, the temporary fix for issue #60, all exit signals
found when erasing transient messages are ignored. This commit
completes that fix. Exit signals coming specifically from the gserv
process to shutdown the connection are also ignored.  So, only signals
from gserv are now processed and all others are flushed.
Contributor

mdaguete commented Jun 22, 2011

I've tested the fixes on my yaws_test project and seems to work ok.

Thank you.

@mdaguete mdaguete closed this Jun 22, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment