Skip to content

Remove unnecessary storing of redirect_url in redirect_info - #4962

Merged
shinrich merged 1 commit into
apache:masterfrom
shinrich:remove-redirect-url
Feb 14, 2019
Merged

shinrich merged 1 commit into
apache:masterfrom
shinrich:remove-redirect-url

Conversation

@shinrich

Copy link
Copy Markdown
Member

We have been having very frequent crashes with our forward caching machines running with follow redirect enabled. It seems to have started occurring when we changed our compiler to gcc 6.2.3. If I recompile with gcc7 the crash goes away. Otherwise, it crashes within 5 minutes. Seems likely there is some underlying issue which the stack trace is so consistent.

[ 00 ] libc-2.17.so        __GI_raise                                                           
[ 01 ] libc-2.17.so        __GI_abort                                                           
[ 02 ] libc-2.17.so        __libc_message                                                       
[ 03 ] libc-2.17.so        _int_free                                                            
[ 04 ] traffic_server      destroy                                                              ( HdrHeap.h:463 )
[ 05 ] traffic_server      destroy                                                              ( HttpTransact.h:1145 )
[ 06 ] traffic_server      HttpSM::cleanup()                                                    ( HttpSM.cc:369 )
[ 07 ] traffic_server      HttpSM::destroy()                                                    ( HttpSM.cc:392 )
[ 08 ] traffic_server      HttpSM::kill_this()                                                  ( HttpSM.cc:7145 )
[ 09 ] traffic_server      HttpSM::main_handler(int, void*)                                     ( HttpSM.cc:2827 )
[ 10 ] traffic_server      Continuation::dispatchEvent(int, void*)                              ( Continuation.cc:46 )
[ 11 ] traffic_server      HttpTunnel::main_handler(int, void*)                                 ( HttpTunnel.cc:1657 )
[ 12 ] traffic_server      Http2Stream::main_event_handler(int, void*)                          ( Http2Stream.cc:93 )
[ 13 ] traffic_server      EThread::process_event(Event*, int)                                  ( UnixEThread.cc:136 )
[ 14 ] traffic_server      EThread::process_queue(Queue<Event, Event::Link_link>*, int*, int*)  ( UnixEThread.cc:175 )
[ 15 ] traffic_server      EThread::execute_regular()                                           ( UnixEThread.cc:235 )
[ 16 ] traffic_server      spawn_thread_internal                                                ( Thread.cc:85 )
[ 17 ] libpthread-2.17.so  start_thread                                                         

I had thought that we fixed it in PR #4902, but alas our production builds are still showing this crash.

So this PR just pulls out storing redirect_info.redirect_url entirely. It doesn't seem like it should be necessary. The client_request URL is set in HttpSM::redirect_request. Then it is reset from redirect_info.redirect_url in HttpTransact::build_request. The comment above that reassignment is below which implies there is some path through the cache logic that will scrozzle the client request URL so we must reset it. I cannot see that scenario. I ran a patched version that did additional URL testing and ran it in our environment, and there never seemed to be a meaningful reset of the redirect url.

// this part is to restore the original URL in case, multiple cache
// lookups have happened - client request has been changed as the result

Of course running in one environment is not exhaustive. Perhaps there are others longer with the project or more intimately acquainted with the follow redirect logic who know why and whether it is necessary to store and reset the redirect_url.

@shinrich shinrich added this to the 9.0.0 milestone Feb 11, 2019
@shinrich shinrich self-assigned this Feb 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants