Re: release vibes?

2021-12-07 Thread Mladen Turk




On 07/12/2021 16:16, Mladen Turk wrote:



On 06/12/2021 11:36, Stefan Eissing wrote:

Friends of httpd, how do you feel about a release in the next two weeks?



+1
Release early, release often



Anyhow, who I'm I to say, not even metinioned on
https://httpd.apache.org/contributors/


Regards
--
^TM


Re: release vibes?

2021-12-07 Thread Mladen Turk




On 06/12/2021 11:36, Stefan Eissing wrote:

Friends of httpd, how do you feel about a release in the next two weeks?



+1
Release early, release often

Regards
--
^TM


Re: release vibes?

2021-12-07 Thread Mladen Turk




On 06/12/2021 12:27, Noel Butler wrote:

On 06/12/2021 20:36, Stefan Eissing wrote:


Friends of httpd, how do you feel about a release in the next two weeks?

Kind Regards,
Stefan


-1

Thats days before christmas, most testers and i'm sure devs will be in 
holiday mode, even if not, that close to christmas means server updates 
are in embargo status in most organisations.





Probably the worst -1 reason ever.



Regards
--
^TM


Re: [RESULT - PASS] Release httpd-2.4.48

2021-05-26 Thread Mladen Turk

Should have vote -1
Patch
http://svn.apache.org/viewvc?rev=1889037=rev
breaks Windows


On 25/05/2021 19:58, Christophe JAILLET wrote:

Hi all,

With 8 binding PMC +1 votes, 5 additional +1 votes from the community, 
and no -1 votes, I'm pleased to report that the vote has PASSED to 
release 2.4.48.


The process of pushing to the distribution mirrors is one the way. I 
should make the announcement in the coming days.




Here are the votes I have recorded during the thread:
(apologies if I missed someone)
PMC:
     dferradal, jfclere, gbechis, jailletc36, jorton, rjung, steffenal,
     ylavic

Community and committers:
     Noel Butler, Jan Ehrhardt, Cory McIntire, William A Rowe Jr (wrowe),
     Ivan Zhakov (ivan)


The systems that have been tested on include:
     CentOS 6, 7, 8
     Debian
     Fedora 34
     RHEL 6, 7, 8
     Slackware 14.0, 14.2 and 15 beta
     SLES 11, 12, 15
     Solaris 10   (Sparc)
     Ubuntu 21.04
     Windows   (x86 and x64)


Thanks to all of you for your time and cycles for testing on all these 
different platforms and configurations.


Christophe JAILLET


--
^TM


Re: Plan to add sandbox branch

2018-11-29 Thread Mladen Turk

On 27.11.2018. 12:23, Jim Jagielski wrote:

In the coming week or so, I will be committing my load balance,
load determination and discovery work to a sandbox trunk. Many
people have asked for more info, so here we go.



Thanks for the info.
Like said, I'm for the idea for advertise/register/unregister
dynamic approach.
Having a basic working implementation, other could add more complex
features and implement additional strategies.
Thus ++1


Regards
--
^TM


Re: Load balancing and load determination

2018-11-07 Thread Mladen Turk

On 30.10.2018. 13:53, Jim Jagielski wrote:

As some of you know, one of my passions and area of focus is
on the use of Apache httpd as a reverse proxy and, as such, load
balancing, failover, etc are of vital interest to me.



Been a while, but seems I'm back :D
Love the idea to have more intelligent then "lets guess"
way of deducting the load balancer score.

What we did for heartbeat/heartmonitor/watchdog can be used
for collecting backend data.

The thing I'm trying to do is the way that backend can
register or remove itself as node inside load balancer.
That would also require some sort of backend-server communication,
shared memory management (mod_slotmem maybe), and a way to
survive graceful restart.

Backend sending its load status at regular intervals would
be addition to "I'm here, count me in" or
"I'm out, bye, good luck with other nodes".

What do you think?



Regards
--
^TM


Re: Balancer Persist testing

2012-12-14 Thread Mladen Turk

On 12/14/2012 01:10 PM, Rainer Jung wrote:


- The Used count in balancer manager drops to 0 after restart/reboot
with persist on. It seems the slot management is not completely right.
Not yet further investigated.



IMHO this should actually be a desired behaviour.
I suppose one would expect to have a 'clean room' after restart.



Regards
--
^TM


Re: Balancer Persist testing

2012-12-14 Thread Mladen Turk

On 12/14/2012 05:15 PM, Rainer Jung wrote:

On 14.12.2012 17:11, Mladen Turk wrote:

On 12/14/2012 01:10 PM, Rainer Jung wrote:


- The Used count in balancer manager drops to 0 after restart/reboot
with persist on. It seems the slot management is not completely right.
Not yet further investigated.



IMHO this should actually be a desired behaviour.
I suppose one would expect to have a 'clean room' after restart.


Please note that Used isn't what it sounds like. It is not a use counter.

It indicates how many slots in slotmem are taken by balancer member
instances, e.g. if your balancer has two members, the Used shows 2
before restart and 0 after.



Ah, I thought you were referring to runtime statistical data.


Regards
--
^TM


Re: Status of Windows-work for 2.4.x

2012-07-18 Thread Mladen Turk

On 07/18/2012 05:49 PM, Jeff Trawick wrote:


Is it possible that this results in flaky behavior depending on
third-party software installed?



Well, MSDN clearly states:
quote
Note: The function pointer for the AcceptEx function must be obtained
at run time by making a call to the WSAIoctl function ...
/quote

If I understand English grammar correctly *must* is something
you can't interpret at will.

However whether this is a reason for a flaky behaviour or not
is a question. But in any case the statement must be obtained
is a pretty clear.


Regards
--
^TM




Re: [VOTE] Release Apache httpd 2.4.1

2012-02-15 Thread Mladen Turk

On 02/13/2012 02:56 PM, Jim Jagielski wrote:


   [X] +1: Good to go



Non binding of course.
Few windows glitches, but mostly build related.


Regards
--
^TM


Re: Intent to TR 2.4.1

2012-02-13 Thread Mladen Turk

On 02/13/2012 04:55 AM, Gregg Smith wrote:

On 2/12/2012 11:30 AM, Mladen Turk wrote:


Note that I have used VC 6.0 + Server 2003R2 PSDK and
build directly from .dsw/.dsp files.
Also I used pcre sources from old httpd (the cmake build just sucks
and I cannot make that working on windoze).



These are VC9 builds here w/ latest PCRE since VC6 is as good as dead. There's 
even been mention to do away with the .dsw/.dsp files which I am strongly 
against for reason other than supporting VC6. This just may have something to 
do with the newer msvcrt.



We should drop all those .dsp/.sln/.vcproj files and have plain nmake build 
system.
I have nmakefiles for apr/apu/iconv/httpd etc.
Offered that of httpd project couple of years back and it was said:
Who will maintain this?. We should use scons, bla, bla ...

Well, the question is who maintains the current unusable build environment?
Currently maintenance is editing .dsp files manually, and please if someone 
can
explain to me how is that simpler the editing makefiles?
Not to mention that Makefile.win which does who know what.


Regards
--
^TM


Re: Intent to TR 2.4.1

2012-02-12 Thread Mladen Turk

On 02/12/2012 04:57 PM, Mario Brandt wrote:

Bug 52402[1] isn't working yet. I wonder why it is marked as fixed in
2.4.x CHANGES[2] The shared memory stuff doesn't work yet on windows.

Odd Behavior:

1. If mod_auth_digest is loaded and on Windows Vista/2008/7 do not try
to start from console, it will not start.



It works for me (winows7 32-bit)


2. If mod_heartmonitor is loaded and using mod_slotmem_shm and on
Windows Vista/2008/7 do not try to start from console, it will not
start.



Again, it works for me, without a hitch.

Note that I have used VC 6.0 + Server 2003R2 PSDK and
build directly from .dsw/.dsp files.
Also I used pcre sources from old httpd (the cmake build just sucks
and I cannot make that working on windoze).


Since both digest and slotem use shared memory I presume that
either its something broken with your compiler or your box.


Regards
--
^TM


mod_slotmem and mod_proxy_balancer/others on win32 (PR52402)

2012-02-03 Thread Mladen Turk

Hi,

mod_slotmem cannot work on windows by design.

On windows we have two processes so the storage-grab/slotmem_grab
will always fail because the inuse flag was already set in the parent,
and since this is shared memory child will see it as used.
On unixes fork is used so the inuse is set only once.

Not sure how to solve this. Perhaps adding generation logic like we
are doing for scoreboard.
In any case until this gets resolved httpd is unusable on win32.


Regards
--
^TM


Re: mod_slotmem and mod_proxy_balancer/others on win32 (PR52402)

2012-02-03 Thread Mladen Turk

On 02/03/2012 11:46 AM, Jim Jagielski wrote:


On Feb 3, 2012, at 4:25 AM, Mladen Turk wrote:


Hi,

mod_slotmem cannot work on windows by design.

On windows we have two processes so the storage-grab/slotmem_grab
will always fail because the inuse flag was already set in the parent,
and since this is shared memory child will see it as used.
On unixes fork is used so the inuse is set only once.



I'm trying to understand this... how is this different from any of
the other mpms which also have at least 2 processes?



Right, seems that's not the reason for PR52402.
Found the fix for it. The reason is the loop:

while (s) {
int i,j;
proxy_balancer *balancer;
sconf = s-module_config;
conf = (proxy_server_conf *)ap_get_module_config(sconf, proxy_module);

/* adding ... */
if (conf-bslot) {
/* We already have shared memory storage created for this 
server_rec.
 * Skip second invocation because there are no more space left in
 * the shm so the storage-grab() will fail.
 */
s = s-next;
continue;
}


Fixes the issue, although I'm not sure that's the correct solution.
Shared memory id uses vhost name for key, and think it should use
vhost:port combination instead.

However I might be wrong and the upper patch is all that's needed
if the balancer is shared between multiple server_rec's


Regards
--
^TM


Re: mod_slotmem and mod_proxy_balancer/others on win32 (PR52402)

2012-02-03 Thread Mladen Turk

On 02/03/2012 02:45 PM, Jim Jagielski wrote:


On Feb 3, 2012, at 8:03 AM, Mladen Turk wrote:


Right, seems that's not the reason for PR52402.
Found the fix for it. The reason is the loop:

while (s) {
int i,j;
proxy_balancer *balancer;
sconf = s-module_config;
conf = (proxy_server_conf *)ap_get_module_config(sconf,proxy_module);

/* adding ... */
if (conf-bslot) {
/* We already have shared memory storage created for this 
server_rec.
 * Skip second invocation because there are no more space left in
 * the shm so the storage-grab() will fail.
 */
s = s-next;
continue;
}


Fixes the issue, although I'm not sure that's the correct solution.
Shared memory id uses vhost name for key, and think it should use
vhost:port combination instead.

However I might be wrong and the upper patch is all that's needed
if the balancer is shared between multiple server_rec's


THANKS! Let me look into this more... at 1st blush, the suggestion
of vhost:port makes sense... maybe even scheme:vhost:port.



Well actually I think that there could be multiple server_rec
for which ap_get_module_config(s-module_config,proxy_module) will
return the same proxy_server_conf.
My patch will handle those cases (the PR52402 itself)

Think I'll commit that cause regardless of anything trying to create
already created shared memory is obvious error.


Regards
--
^TM


Re: remove mod_heart* from 2.4?(was: 2.4.0 GA This week?)

2012-02-03 Thread Mladen Turk

On 01/03/2012 09:22 AM, Gregg L. Smith wrote:

Since I have been the most vocal about this watchdog/hearmonitor/heartbeats on 
windows ... I should chime in.


Is the issue still present and what the issue actually is.
I have watchdog/hearmonitor/heartbeat working on windows
using the current svn 2.4.x branch.

If you can share some light what's broken I can try to fix that.



Regards
--
^TM


Re: remove mod_heart* from 2.4?(was: 2.4.0 GA This week?)

2012-02-03 Thread Mladen Turk

On 02/04/2012 12:27 AM, William A. Rowe Jr. wrote:

On 2/3/2012 12:51 PM, Gregg Smith wrote:

a way of monitoring a cluster of servers and opening another way of balancing 
the load
(lb_meathod_byheartbeat).

This is what I see when I look at the bundle.


With what external mechanisms that exist today?  Over what protocol?
In use today by mod_proxy_balancer?


The protocol allows to exchange heartbeat info between multiple
httpd instances and as such is irrelevant.
Although could be made public so that other app servers can
post their status to heartmonitor allowing to add/remove
group members when they go on/off line (at least that's the idea).


I'll review the docs myself next
week when I come up for air, but what I don't want to do is ship
something a typical user can't directly take advantage of without
third party modules.


No third party modules is needed.
You need frontend httpd and bunch of backend httpd+php or something
like that.


Regards
--
^TM


Re: Win :: apr-util-1.4.1

2011-12-08 Thread Mladen Turk

On 12/08/2011 01:04 PM, Steffen wrote:

Building out of the box on Windows including apr_crypto_oppenssl.
Also apr_crypto_nss compiles fine, but have no nss3.lib here yet, so cannot 
link now.


1. You should use apr developers list
   http://apr.apache.org/mailing-lists.html
2. Use Mozilla's Xulrunner (Gecko) SDK
   https://developer.mozilla.org/en/Gecko_SDK


Regards
--
^TM


Re: : apr-util-1.4.1 failes with Crypto

2011-12-08 Thread Mladen Turk

On 12/08/2011 03:47 PM, Steffen wrote:

When APU-HAVE-CRYPTO = 0 and build project seperate it generates fine a
apr_crypto_nss-1.dll (dynam)

When APU-HAVE-CRYPTO = 1 and build project seperate it fails with:

-- Build started: Project: apr_crypto_nss, Configuration: Release
Win32 --
Compiling... apr_crypto_nss.c
.\apr_crypto_nss.c(33) : fatal error C1083: Cannot open include file:
'prerror.h': No such file or directory



You should have INCLUDE set correctly. peerror.h is from NSPR.
Or simply just copy those files to apr-util/include/
if you just need the .dll's

Like Graham said, crypto modules are dynamic and will not work
with static APR build. So you basically cannot have
APU_DECLARE_STATIC and 'APU_HAVE_CRYPTO 1'



Regards
--
^TM


Re: Windows Laundry List pt3, mod_watchdog

2011-12-05 Thread Mladen Turk

On 12/05/2011 08:41 AM, William A. Rowe Jr. wrote:

On 12/5/2011 1:22 AM, Mladen Turk wrote:


Like said on another thread, give me couple of days and I'll fix the issue.
Well, as soon as I compile httpd-2.4 on windows which might be tricky cause
build procedure is completely broken and it doesn't compile any more out of the 
box.


It has been building for Gregg and I (at least somewhat recently)
so please be specific?  If this is your interesting psdk logic,
that might be a contributing factor.


Nope. Its VS2008
Put pcre, branches/apr-1.4.x, branches/apr-util-1.4.x, apr-iconv/trunk
inside srclib
Disabled deflate, ssl, lua, etc...

Each project/module reports
Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
Copyright (C) Microsoft Corporation.  All rights reserved.
fatal error RC1107: invalid usage; use RC /? for Help
Project : error PRJ0002 : Error result 1 returned from 'C:\Program 
Files\Microsoft SDKs\Windows\v6.0A\bin\rc.exe'.

Then ...
123.\mod_socache_dc.c(28) : fatal error C1083: Cannot open include file: 
'distcache/dc_client.h': No such file or directory
123Build log was saved at 
file://c:\Workplace\httpd-2.4.x\modules\cache\Debug\BuildLog.htm
123mod_socache_dc - 1 error(s), 0 warning(s)


Then ...
126-- Build started: Project: mod_lbmethod_rr, Configuration: Debug Win32 
--
126Compiling...
126mod_lbmethod_rr.c
126.\mod_lbmethod_rr.c(54) : error C2039: 'name' : is not a member of 
'proxy_balancer'
126c:\Workplace\httpd-2.4.x\modules\proxy\mod_proxy.h(430) : see 
declaration of 'proxy_balancer'


And finally it gives:
== Build: 13 succeeded, 106 failed, 0 up-to-date, 0 skipped ==


Regards
--
^TM


Re: Windows Laundry List pt3, mod_watchdog

2011-12-05 Thread Mladen Turk

On 12/05/2011 08:41 AM, William A. Rowe Jr. wrote:

On 12/5/2011 1:22 AM, Mladen Turk wrote:


Like said on another thread, give me couple of days and I'll fix the issue.
Well, as soon as I compile httpd-2.4 on windows which might be tricky cause
build procedure is completely broken and it doesn't compile any more out of the 
box.


It has been building for Gregg and I (at least somewhat recently)
so please be specific?  If this is your interesting psdk logic,
that might be a contributing factor.



OK, been able to compile with VS6 and SDK 2003R2
However recent dependency on pcre.dll still makes problems building.

This means we longer can compile httpd without
third party dependency. What's worse CMake is required to build that
so this is a huge step back, since we are not self contained any more
for the (at lest bare) compilation.

OK, whatever. Should have pay attention earlier.
Anyhow, why we require pcre.dll? Think it can be statically compiled.
using
-copy srclib\pcre\pcre.$(src_dll)
instead
copy srclib\pcre\pcre.$(src_dll)
allows to have pcre statically compiled (even the one from 2.2.x works)



Regards
--
^TM


Re: Windows Laundry List pt3, mod_watchdog

2011-12-05 Thread Mladen Turk

On 12/04/2011 10:33 PM, Gregg L. Smith wrote:

On 12/4/2011 8:46 AM, Rainer Jung wrote:

Picking up this old discussion:


Well, this is the same chunk of Win32 specific debugging code causing this 
module to
crash yet again.


Gregg: Can you tell us, in which line it is crashing?

Debugger says here (see attached).

WatchdogInterval set or not.



Fixed in the trunk and 2.4.x
Willing to retest?

Regards
--
^TM


Re: Windows Laundry List pt3, mod_watchdog

2011-12-05 Thread Mladen Turk

On 12/05/2011 10:57 PM, Gregg L. Smith wrote:

On 12/5/2011 5:15 AM, Mladen Turk wrote:
Please backport to 2.4.



Like said, already backported.


Regards
--
^TM


Re: Are we there yet?

2011-12-04 Thread Mladen Turk

On 12/03/2011 08:32 AM, Gregg L. Smith wrote:

On 12/2/2011 3:48 PM, Stefan Fritsch wrote:

- modules docs
- the follwing modules added since 2.2 lack documentation
- mod_watchdog
- mod_heartbeat
- mod_heartmonitor
- mod_lbmethod_heartbeat

I vote these off the Windows boat, mod_watchdog crashes the child processes on 
Win and is basically required for the rest of them, in a round about way. I 
even asked Steffen at Apache Lounge to check it for me. I have more detail, but 
I have spoken up
about it long ago and I have seen no movement from original author. However, if 
someone wants to know, feel free to ask.



If its crashing it should be fixed. There is nothing in that
module that would crash 'by-design' so its probably some
bug introduced later after my initial commit.

Give me couple of days and I'll fix the module, and
write some docs.


Regards
--
^TM


Re: Are we there yet?

2011-12-04 Thread Mladen Turk

On 12/04/2011 06:37 PM, Jim Jagielski wrote:



Let's shoot for an RC1 this week. I'll RM.


Do we have bundled apr/apr-util versions defined?



Regards
--
^TM


Re: Are we there yet?

2011-12-04 Thread Mladen Turk

On 12/04/2011 07:25 PM, Graham Leggett wrote:

On 04 Dec 2011, at 8:03 PM, Mladen Turk wrote:


Let's shoot for an RC1 this week. I'll RM.


Do we have bundled apr/apr-util versions defined?


Ideally we want apr-util v1.4.0, which is yet to be released. I've proposed to 
RM a release of apr-util this weekend or next week to the APR project and 
haven't had any objections, am still happy to do so.



So the lazy consensus rule applies. Feel free to cut the release.


Regards
--
^TM


Re: Windows Laundry List pt3, mod_watchdog

2011-12-04 Thread Mladen Turk

On 12/04/2011 10:33 PM, Gregg L. Smith wrote:

On 12/4/2011 8:46 AM, Rainer Jung wrote:

Picking up this old discussion:

On 03.07.2011 19:40, William A. Rowe Jr. wrote:

On 7/1/2011 12:26 AM, Mladen Turk wrote:

On 07/01/2011 06:31 AM, Gregg L. Smith wrote:

Hi folks,

Well, this is the same chunk of Win32 specific debugging code causing this 
module to
crash yet again.


Gregg: Can you tell us, in which line it is crashing?

Debugger says here (see attached).

WatchdogInterval set or not.



It actually means that pre-config failed.
I suspect that the change introducing

if (ap_state_query(AP_SQ_MAIN_STATE) == AP_SQ_MS_CREATE_PRE_CONFIG)
/* First time config phase -- skip. */
   return OK;
inside pre_config hook is the cause.

It bypasses creation of wd_server_conf, and the child_hook is missing the 
server conf.
So either the first one should be deleted or something similar should be done 
on child hook.

Like said on another thread, give me couple of days and I'll fix the issue.
Well, as soon as I compile httpd-2.4 on windows which might be tricky cause
build procedure is completely broken and it doesn't compile any more out of the 
box.



Regards
--
^TM


Re: [VOTE] Release Apache httpd-2.3.13 as beta

2011-07-03 Thread Mladen Turk

On 07/03/2011 02:21 PM, Steffen wrote:

The candidate Windows binary is now available at:

http://www.apachelounge.com/viewtopic.php?p=18457



Not that it belongs here, but may I ask why the .rar?


Regards
--
^TM


Re: Windows Laundry List pt3, mod_watchdog

2011-07-03 Thread Mladen Turk

On 07/03/2011 07:40 PM, William A. Rowe Jr. wrote:

On 7/1/2011 12:26 AM, Mladen Turk wrote:

On 07/01/2011 06:31 AM, Gregg L. Smith wrote:

Attached patch just gets rid of it.



This cannot be omitted.
Getting the parent pid means we we are in the child process, so we must not
init the parent watchdog thread (see 'return OK;')


That's not how to detect it, you break -X mode.

There is an ap_mpm_query to determine if this is the child.


OK. Now, that it builds I'll fix that.
(after I upgrade my nmake makefiles from 2.2 to 2.3)

I offered that to the httpd couple of years back,
but the rejection was: Who will maintain windows nmake files
IMHO those are few order of magnitude simpler then maintaining
VS workspace/solutions/projects (how many we have them currently?)
162 counting apr/apr-util/apr-iconv!
And that's easier to maintain? Yeah right.


Regards
--
^TM


Re: Windows Laundry List pt3, mod_watchdog

2011-07-03 Thread Mladen Turk

On 07/03/2011 08:52 PM, William A. Rowe Jr. wrote:

On 7/3/2011 1:49 PM, Mladen Turk wrote:


I offered that to the httpd couple of years back,
but the rejection was: Who will maintain windows nmake files
IMHO those are few order of magnitude simpler then maintaining
VS workspace/solutions/projects (how many we have them currently?)
162 counting apr/apr-util/apr-iconv!
And that's easier to maintain? Yeah right.


The answer is generating them from build.py etc, just as we generate
the makefiles from config.m4.  In fact the right clues embedded in
config.m4 files might let us use these as sources ;-)


No problem, just throw in dependencies.
We already need cmake for pcre, perl for openssl, now python ...
Why not just using the entire internet ;) ?


Cheers
--
^TM


Re: Windows Laundry List pt3, mod_watchdog

2011-07-03 Thread Mladen Turk

On 07/03/2011 08:58 PM, William A. Rowe Jr. wrote:

On 7/3/2011 1:52 PM, William A. Rowe Jr. wrote:




Mladen, do you know anything of cl.exe's ability to generate dependencies?
I've never looked before.


I created an util
http://myomake.svn.sourceforge.net/viewvc/myomake/trunk/misc/tools/windows/mkdepend/
as part of my next pet project: make/nmake/cmake/build.py replacement :)


Cheers
--
^TM


Re: Windows Laundry List pt3, mod_watchdog

2011-07-01 Thread Mladen Turk

On 07/01/2011 09:10 AM, Gregg L. Smith wrote:

Hi Mladen,
Ok, I'm just a dumb guy but for me, if it drops to the hard drive (it's built 
on my platform) it should at minimum load without crashing the server.


Who said anything about being dumb.
If it crashes on load, it should be fixed. Simple as filing a bug report.


I personally have no use for any of this (watchdog, 
heartmonitor,heartbeat,lbmethod_heartbeat) that I know of at this time, they do 
all seem to be connected though so let those that do have use on Windows get it 
actually working.
That said, works may not be correct, but with this code in, it crashes the 
child every time the child tries to load the module. Without this code, the 
module loads and I start seeing this in my debug log;



OK. Checking now, and will try to implement a fix so it don't crashes.
Disabling code is not a solution (quick one yes).


Regards
--
^TM


Re: [VOTE] Release Apache httpd-2.3.13 as beta

2011-07-01 Thread Mladen Turk

On 07/01/2011 06:08 AM, Gregg L. Smith wrote:

Hi Bill, Steffen,

All I can add to this at the moment is this is happening in XP, I am running in 
Vista x86 just fine.  I have not built on 2008 R2 x64 yet but I will assume 
(ouch) for now it will work fine there as well.


Same here. XP/SP3 is unusable and didn't came to the Win7 yet.
Endless loop of assertions and debugger cannot actually help.
httpd -X helps but only that you have to click 20 times on
the assertion popup.

Some apr-util stuff like dbm is almost impossible to
build and wasn't able to compile the ldap at all.
I used Apache.dsw to create .mak files and that produced
unusable build cause pcre is missing
(The one from 2.2 doesn't work unless you manually copy files, and
 axe pcre(posix).dll in install)

Bottom line. Needs some work to get that into the shape so that
folks can build it.


Regards
--
^TM


Re: [VOTE] Release Apache httpd-2.3.13 as beta

2011-07-01 Thread Mladen Turk

On 07/01/2011 07:57 PM, Steffen wrote:

PCRE is now a dep.

Download 8.12 from ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/
and compile the pcre.dll with CMake options:

BUILD_SHARED_LIBS and CMAKE_BUILD_TYPE RelWithDebInfo.



That's ridiculous.
WTF has httpd win32 port gone?


Regards
--
^TM


Re: [VOTE] Release Apache httpd-2.3.13 as beta

2011-07-01 Thread Mladen Turk

On 07/01/2011 09:45 PM, Steffen wrote:


No problem for me to distribute the non ASF(apr) deps at
http://www.apachelounge.com/

Like pcre, lua, openssl and zlib.



Right, and after so many years it is now
impossible to build httpd from ASF source dist only.
Since you cannot compile httpd without pcre this
means that we suddenly ship non buildable code.

openssl and zlib were always optional components
and you could still build httpd without them.


Regards
--
^TM


Re: Windows Laundry List pt3, mod_watchdog

2011-06-30 Thread Mladen Turk

On 07/01/2011 06:31 AM, Gregg L. Smith wrote:

Hi folks,

Well, this is the same chunk of Win32 specific debugging code causing this module to 
crash yet again. I remember suggesting it be removed before, now I am a little more 
adamant about it because it is really not needed, IMO of course. If you really got to 
have it there, please  a
_DEBUG to the #ifdef WIN32.
This module is needed for heartmonitor (which has it's own problems coming under 
separate cover). So, either it crashes on win32 or it works, your choice :-) If 
your choice is let it fail, then get rid of it all, heartbeat, heartmonitor, 
lb_method_heartmonitor  watchdog on Windoze. Of course, if there is no 
improvement on documentation, most of it will go bye bye come GA anyway, per what 
is stated in STATUS.
Attached patch just gets rid of it.



This cannot be omitted.
Getting the parent pid means we we are in the child process, so we must not
init the parent watchdog thread (see 'return OK;')

Parent watchdog thread is windows specific and allows to have a
watchdog registered in parent process since the way how parent
and child cooperate is different then on unixes since there's no
fork() available.

How exactly does it crash? You say
either it crashes on win32 or it works with a smiley,
is not very informative.


Regards
--
^TM


Re: id=51247 Enhance mod_proxy and _balancer with worker status flag to only accept sticky session routes

2011-05-25 Thread Mladen Turk

On 05/25/2011 02:27 AM, Daniel Ruggeri wrote:

I attached the patch to a bug opened by Cameron Stokes
https://issues.apache.org/bugzilla/show_bug.cgi?id=48841



Just a quick note on the first thing I saw:

+//worker-lbfactor = atoi(val);
+worker-lbfactor = strtol(val, NULL, 10);
+if (errno == EINVAL || worker-lbfactor  0 || worker-lbfactor  100)

You should add
errno = 0;
before strtol call if you inspect the errno afterwards.
BTW, what's wrong with the atoi call? We ain't gonna have 64-bit lbfactors,
and the acceptable range is 0 ... 100
Also, don't use C++ comments.


Regards
--
^TM


Re: Prior to apr 2.0 / httpd 2.4...

2011-03-20 Thread Mladen Turk

On 03/21/2011 12:47 AM, William A. Rowe Jr. wrote:

Nobody has offered a reasonable response, let's try this again... the
availability of pcre and expat are generally a both-or-neither proposition
on most distributions.  Ergo, any one of the following resolutions would
restore logically consistency to the next-generation distribution...

  [X] apr 2.0 should resume bundling expat 2.0.1 fork[1]
  [ ] expat helpers should be dropped from apr 2.0,
  while httpd should assume an ap_ interface to expat
  with expat distributed with httpd-deps
  [ ] expat helpers should be dropped from apr 2.0,
  in favor of direct consumption of expat 2.x by httpd,
  with expat distributed with httpd-deps
  [ ] httpd will ship expat in srclib/apr/xml
  in spite of apr project decisions
  [ ] httpd-deps should drop pcre
  [ ] httpd-deps should be dropped

Simple majority, will re-offer this vote with the lowest vote getter dropped
until we have consensus.  Votes please?

[1] Note particularly that expat appears to be abandoned, no releases in almost
 4 yrs, with a significant security issue hanging over it we patched in apr.
 No effort appears to be expended in providing any alternate non-expat 
apr_xml
 interfaces.



The first option seems the least invasive at the moment.
However since we have in many places the provider kind of API
I see no reason why the same shouldn't be done for xml parsers
and regular expressions. Think even httpd trunk has already some
code that uses both regex and pcre.


Regards
--
^TM


Re: PHP5.3.6

2011-03-18 Thread Mladen Turk

On 03/18/2011 04:12 PM, Rich Bowen wrote:


On Mar 18, 2011, at 10:55 AM, Jeff Trawick wrote:



What would it take, from our side or from Stefan's, to make it ok for us to say go 
here for Windows binaries? It surely seems that this would be a big win for both of 
us.



AFAICT they do not produce .msi installer, only .zip files
However I have httpd binaries linked to msvcrt.dll and build
by VS2008 which offer the highest possible compatibility.

See:
http://www.syndicateofideas.com/posts/fighting-the-msvcrt-dll-hell

It uses the latest WindowsDDK compilers which Microsoft
is using to compile system components.

I also use this system for quite some time for producing
commons daemon and few other windows binaries.


Regards
--
^TM


Re: PHP5.3.6

2011-03-18 Thread Mladen Turk

On 03/18/2011 04:43 PM, Jeff Trawick wrote:


what if we add text to our download that says that official PHP
binaries for Windows starting with 5.3.6 no longer work with our
stable-ABI builds



+1


Regards
--
^TM


Re: PHP5.3.6

2011-03-18 Thread Mladen Turk

On 03/18/2011 04:55 PM, Rich Bowen wrote:


On Mar 18, 2011, at 11:48 AM, Mladen Turk wrote:


On 03/18/2011 04:43 PM, Jeff Trawick wrote:


what if we add text to our download that says that official PHP
binaries for Windows starting with 5.3.6 no longer work with our
stable-ABI builds



+1


Doing that without suggesting an alternative seems discourteous both to these 
Windows users and to the PHP community.



Alternative would be We are looking for a solution.
We don't need to give up before even trying.

I gave the alternative by using winddk compilers.
If compiled using those tools it works perfectly with both old and new php 
versions.

Look at thread few weeks ago.
Bill said he will use VS2010, so given that PHP uses VS2008
we are again in endless loop of catching one other's version.

Like I suggested, we could avoid linking to msvcrtXX.dll
which will allow any third party plug-in to work seamlessly.



Regards
--
^TM


Re: PHP5.3.6

2011-03-18 Thread Mladen Turk

On 03/18/2011 05:19 PM, Graham Dumpleton wrote:

On 18 March 2011 07:24, Rich Bowenrbo...@rcbowen.com  wrote:

If I read this right, this is a similar issue to what we have in the
Python world with some Python extension modules on Windows.

One discussion thread about it can be found at:

   http://psycopg.lighthouseapp.com/projects/62710/tickets/20

Scan down towards end of discussion for overview.



I don't think that relates to the original problem.
Here, php crashes the httpd caused by msvcrt incompatibilities.
Well, it actually asserts the 'Runtime initialization'.



Regards
--
^TM


Re: official httpd VC9 builds

2011-01-31 Thread Mladen Turk

On 01/31/2011 11:54 AM, Ferenc Kovacs wrote:



On Mon, Jan 31, 2011 at 10:54 AM, Nick Kew n...@webthing.com 
mailto:n...@webthing.com wrote:


On 31 Jan 2011, at 09:39, Ferenc Kovacs wrote:

  does that mean that you can either support/provide the VC6 OR the VC9 
builds, but not both?

Providing any kind of binaries is not Apache's business.
Third-parties like apachelounge do that.

Why does it matter what the binary is built with?
Complain to Microsoft if they've broken compatibility!


can I quote your words?



Each VC has it own MSVCRTxx.dll which is of course
incompatible with the previous.

For httpd to support modules build by a third party
the only viable solution is to use MSVCRT.dll
(VC6 is the last one that allows you to do that)

If we build with VC9 any module build with  VC9
would be probably broken, so it would have to be
recompiled with the VC version we are using.



Regards
--
^TM


Re: official httpd VC9 builds

2011-01-31 Thread Mladen Turk

On 01/31/2011 04:34 PM, William A. Rowe Jr. wrote:


There are a host of reasons we never supported MSVCRn where n is an
arbitrary value modified by Microsoft on a biannual basis.

But indeed, at 2.4 we will be shipping to the then-shipping crt, not
vc9.



And the winner would be?


Regards
--
^TM


Re: official httpd VC9 builds

2011-01-31 Thread Mladen Turk

On 01/31/2011 04:36 PM, William A. Rowe Jr. wrote:

On 1/31/2011 4:05 AM, Issac Goldstand wrote:

I believe also that wrowe mentioned to me that  we wanted to support
command line (make) builds, and VC9 doesn't allow us to export makefiles.

I'm +1 for making both VC6 and VC9 builds from 2.4 and on, like PHP does.


In this case, your +1 means you are offering to do so :)

Binaries are built by whichever committers feel like building binaries, period.

I have no interest in VC9, it's already stale.  At least if we pick up the
then-shipping flavor as of 2.4.0, we stand to win by sticking with that
specific version to the end of the 2.4 lifespan.



There is a solution to use DDK7.1
It can create binaries that links to MSVCRT, however
this works for XP+ only.



Regards
--
^TM


Re: official httpd VC9 builds

2011-01-31 Thread Mladen Turk

On 01/31/2011 06:20 PM, William A. Rowe Jr. wrote:

On 1/31/2011 9:55 AM, Mladen Turk wrote:


There is a solution to use DDK7.1
It can create binaries that links to MSVCRT, however
this works for XP+ only.


Which works... provided we continue on the makefile approach or use msbuild.
Note that openssl encourages exactly this solution, and goes out of their way
to avoid msvcrXX flavors.



IDE is probably good enough for GUI apps, but that's just my
opinion. With each version it's a completely new environment,
and I personally see no point of using it for non-interactive projects.
Sure, debugger might be handy but think this is usable without
IDE dependency.



There are now other reasons to avoid msvcrt.dll, given that the maintainers
have declared msvcrt to be an OS component, and have declined to track C
standards or portability.  This is evidenced in their handling of *printf
family of functions, which PHP folks have tripped over in awkward ways, and
found no satisfaction reporting the issues to MS.



This is marketing bs from ms IMHO.
They use msvcrt for non-system components as well like IIS and stuff.
Well I suppose they wish that treated to be system component
but then it executes the extensions from userland.
Now add multiple extensions/filters with various dll linkage and
you are just asking for trouble.



If anyone notices apr or httpd exchanging such resources in a way that would
make httpd crash, we would *love* to know about it!  This is the time for us
to complete any corrections to the API, before httpd 2.4 ships.



If we resist on using CRT stuff like strcpy_l/strcpy_s, _fstat64i32 and
other weirdness from contemporary CRTs, we'd be fine.


Regards
--
^TM


Re: official httpd VC9 builds

2011-01-31 Thread Mladen Turk

On 01/31/2011 07:33 PM, William A. Rowe Jr. wrote:

On 1/31/2011 12:17 PM, Mladen Turk wrote:


If we resist on using CRT stuff like strcpy_l/strcpy_s, _fstat64i32 and
other weirdness from contemporary CRTs, we'd be fine.


Actually most of those date back to msvcrt.dll or have been added over the
years.  I was rather shocked while researching the i64 stubs of zlib to find
that everything required is already in VC6/msvcrt.dll.



Sure. At my day job I'm using WinDDK7.1 which is VS2008 (_MSC_VER 15.0)
I had to create a stub for 3 missing exports (_getpid, _environ and _wenviron)
and beside hassle of linking with additional missing stub that comes
with DDK, it works perfectly.
I even have a batch file (well toolkit) that compiles a custom VC distribution
out of DDK and latest windows SDK.

Not saying this is necessary a solution for us, but there might
be problems with modules that use JNI, since JDK is build with VS 2003,
and of course with getenv/putenv at least.

Perhaps for well-known problematic stuff like getenv/putenv we
should use PostgreSQL approach for example [1].
They call _putenv on *all* in-proc MSVCRTnn.dll possibilities
so they all get the same environment.

[1] 
http://git.postgresql.org/gitweb?p=postgresql.git;a=blob_plain;f=src/port/win32env.c


Regards
--
^TM


Re: 2.4 and APR_HAS_THREADS, etc

2011-01-10 Thread Mladen Turk

On 01/07/2011 08:27 PM, Jim Jagielski wrote:



For right now, APR_HAS_SHARED_MEMORY and APR_HAS_THREADS
should be dropped for 2.3/2.4. I'd be happy with that for
now ;)



+1

I raised that question few years back and was told
that the reason for (at least APR_HAS_THREAD) was
not the lack of os support for threads but rather the
optimization for prefork. OK ;)


Regards
--
^TM


Re: Arranging mod_proxy_balancer in trunk

2010-04-07 Thread Mladen Turk

On 04/07/2010 03:31 PM, jean-frederic clere wrote:

Hi,

In mod_proxy_balancer after
runtime = find_session_route(*balancer, r,route,sticky, url);

There is a logic that belongs to the LB implementation, my idea is to add a
apr_status_t (*updatelbstatus)(proxy_balancer *balancer, proxy_worker
*elected, server_rec *s);
in the proxy_balancer_method (mod_proxy.h) and call the LB implementation.

Comments?



+1

However if the balancer doesn't implement his own session
affinity determination logic, default one should be used thought,
so that we don't duplicate the code inside each balancer

Regards
--
^TM


Re: svn commit: r923712 - in /httpd/httpd/trunk/docs/manual: ./ mod/

2010-03-16 Thread Mladen Turk

On 03/16/2010 06:24 PM, Roy T. Fielding wrote:


I thought the only people who ever capitalize HTTP in httpd are
clueless lawyers.


apache_1.2.4.tar.gz/ABOUT_APACHE

The Apache HTTP Server Project
  http://www.apache.org/
 June 1997

Seems the HTTPD is used for a long time

Regards
--
^TM


Re: svn commit: r923712 - in /httpd/httpd/trunk/docs/manual: ./ mod/

2010-03-16 Thread Mladen Turk

On 03/16/2010 09:37 PM, William A. Rowe Jr. wrote:


I thought the only people who ever capitalize HTTP in httpd are
clueless lawyers.


apache_1.2.4.tar.gz/ABOUT_APACHE

The Apache HTTP Server Project
   http://www.apache.org/
  June 1997

Seems the HTTPD is used for a long time


I'm sorry, I'm looking at your snip and I don't see a captial D.



Choose one. D or d :)

IMHO Apache HTTPD is no better then Apache httpd.
It should be Apache Httpd thought.



Regards
--
^TM


Re: [vote] release 2.2.15?

2010-03-04 Thread Mladen Turk

On 03/04/2010 12:29 AM, Joe Orton wrote:


I'm fairly happy with refusing client-initiated reneg regardless.



+1

Explicit OpenSSL option
e.g. SSL_OP_DISABLE_CLIENT_INITED_RENEGOTIATION
would be helpful and we won't be needing info callback
in that case (which doesn't get called from SSL_CB_ACCEPT_LOOP
for legacy clients anyhow)


Regards
--
^TM


Re: [vote] release 2.2.15?

2010-03-03 Thread Mladen Turk

On 03/02/2010 07:09 AM, William A. Rowe Jr. wrote:

Candidate at the usual /dev/dist/ URL; Your votes please...

   +/-1
   [ X] Release 2.2.15



Win32/Win64/Fedora12/Solaris10



I'll proceed to fight with win32 tomorrow, fighting with my linux vm was
enough fun for one day :)



BTW, I wouldn't recommend to compile against 0.9.8m.
openssl s_client  0.9.8m block on renegotiation


Regards
--
^TM


Re: [vote] release 2.2.15?

2010-03-03 Thread Mladen Turk

On 03/03/2010 07:02 PM, William A. Rowe Jr. wrote:

On 3/3/2010 11:50 AM, Stefan Fritsch wrote:

On Wednesday 03 March 2010, Mladen Turk wrote:

BTW, I wouldn't recommend to compile against 0.9.8m.
openssl s_client  0.9.8m block on renegotiation


Have you only tried 0.9.8l as client? It has a known bug with
renegotiation that makes it hang instead of fail.

I have no problems with 0.9.8c and 0.9.8g (from Debian 4.0 and 5.0).
If SSLInsecureRenegotiation is on, it works. If
SSLInsecureRenegotiation is off, I get an sslv3 alert handshake
failure.


And the bug is specific to openssl  0.9.8m mishandling the alert; it will
neither abort nor resume the prior session, so it is left to timeout.  You
may want to contrast this behavior to legacy IE, Firefox, etc.



Right, and I'm afraid if SSLInsecureRenegotiation (default) isn't set
while compiled with 0.9.8m one can easily create an DoS attack.

I might be wrong, but if the client is 0.9.8k it just stays
connected for server timeout. Sure it's disconnected if
SSLInsecureRenegotiation is set, but then what's the point?


Regards
--
^TM


Re: [vote] release 2.2.15?

2010-03-03 Thread Mladen Turk

On 03/03/2010 10:34 PM, William A. Rowe Jr. wrote:

On 3/3/2010 2:00 PM, Mladen Turk wrote:


Right, and I'm afraid if SSLInsecureRenegotiation (default) isn't set
while compiled with 0.9.8m one can easily create an DoS attack.


Stop.



Weather I stop or not it will not make that disappear :)



Please don't abuse words like DoS to describe utilization.  Of course IE
and Firefox, Opera and Safari are all DoS tools.  It's called consuming
server resources :)



while [ true ];
do
echo R | openssl s_client -connect host:port 
done

Not only it will kill the server, but it will kill your box as well :)

Seriously, I was hoping 0.9.8m will reject legacy clients,
unless explicitly SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION is set,
but it seems that's not the case or we are doing something wrong in mod_ssl.


Regards
--
^TM


Re: [vote] release 2.2.15?

2010-03-03 Thread Mladen Turk

On 03/03/2010 11:01 PM, Joe Orton wrote:

On Wed, Mar 03, 2010 at 06:31:36PM +, Dr Stephen Henson wrote:

If I understand the code correctly it looks like Apache is already
trapping and aborting client initiated renegotiations so this hang
situation shouldn't arise.


This is true for client-initiated reneg, I'm not sure whether Mladen was
talking about client- or server- initiated reneg, Mladen can you clarify
exactly what problem you're seeing?



Very simple to duplicate, just find any = 0.9.8k client

mod_ssl + openssl-0.9.8m
SSLInsecureRenegotiation on
echo R | openssl-0.9.8m s_client  .. disconnects
echo R | openssl-0.9.8k s_client  .. disconnects

SSLInsecureRenegotiation off
echo R | openssl-0.9.8m s_client  .. disconnects
echo R | openssl-0.9.8k s_client  .. hangs until ServerTimeout

Client reneg is rejected by our info callback
(which might be good or not, but that's not the point)
except with 0.9.8m and legacy clients.



Regards
--
^TM


Re: [vote] release 2.2.15?

2010-03-03 Thread Mladen Turk

On 03/03/2010 11:33 PM, William A. Rowe Jr. wrote:



Seriously, I was hoping 0.9.8m will reject legacy clients,
unless explicitly SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION is set,
but it seems that's not the case or we are doing something wrong in
mod_ssl.


It rejects the renegotation.  It is the callers responsibility to continue
or die.  Dr Henson's suggested approach is that we drop the timeout to
some 5 seconds or less, in this case, until they resume the connection.



Sure that could be the solution if there is no option to tell the
server to make that decision.


Regards
--
^TM


Re: [vote] release 2.2.15?

2010-03-03 Thread Mladen Turk

On 03/03/2010 11:45 PM, William A. Rowe Jr. wrote:

On 3/3/2010 4:44 PM, Mladen Turk wrote:


Sure that could be the solution if there is no option to tell the
server to make that decision.


It's not the server's to make, this alert follows the TLS specification.



Didn't meant that, but anyhow...
Still doesn't smell clean, but seems everyone else
think this is not an issue, so fine with me.


Regards
--
^TM


Re: r833582

2009-11-17 Thread Mladen Turk

On 17/11/09 10:06, Plüm, Rüdiger, VF-Group wrote:

I now see the following warning:

ssl_engine_kernel.c: In function `ssl_callback_Info':
ssl_engine_kernel.c:1943: warning: passing arg 1 of `SSL_state' discards
qualifiers from pointer target type



See the:
https://svn.apache.org/viewvc/tomcat/native/trunk/native/include/ssl_private.h?r1=802231r2=835322diff_format=h

I've used 'const SSL *' and it compiles (and works)
without that warning

Regards
--
^TM



Re: balancer-manager and server-status feature request.

2009-11-16 Thread Mladen Turk

On 16/11/09 11:33, Mark Watts wrote:


The statistics one gets from both /balancer-manager and mod_status are
useful but of course only exist until httpd is restarted.

It would be nice if they could be configured to periodically write some
lines to the error log (at LogLevel info or so) with these statistics so
the data can be preserved.


This could be done using watchdog module that would fire some
balancer log module.
Regarding xml data, it is my long standing wish to create
log output filter sub module system where the log lines would
go trough a VFS filter capable of writing to xml, database, etc
(depending on the VFS implementation).


If you came up with such a module I'd be happy to review it :)

Regards
--
^TM



Re: Httpd 3.0 or something else

2009-11-08 Thread Mladen Turk

On 06/11/09 20:07, Jim Jagielski wrote:




I'd like we remove the entire forwarding proxy stuff
for example.

So we have mod_forward_proxy and mod_reverse_proxy? Interesting
take. Would make some sense to make mod_proxy and top-level framework
and forward/reverse as submodules.



I'd like that we clear the current dependency and API mess.
E.g common code depends on balancer (which was a dirty hack
I did so we can setup the workers)
This would obviously require some decent shared memory code
that would allow dynamic config instead stealing the space
from the scoreboard. Think that shared memory rewrite was
one of the major topics inside 'Amsterdam' discussion
few years back.


Regards
--
^TM



Re: Httpd 3.0 or something else

2009-11-05 Thread Mladen Turk

On 05/11/09 12:38, Graham Leggett wrote:

Jim Jagielski wrote:


Let's get 2.4 out. And then let's rip it to shreds and drop
buckets/brigades and fold in serf.


I think we should decide on exactly what problem we're trying to solve,
before we start thinking about how it is to be solved.



+1

I'd like we remove the entire forwarding proxy stuff
for example. There are also few other things that simply
doesn't fit inside 'that web server thing' thought.
Others might simply have different ideas.

So IMHO we should define what we wanna do first.


Regards
--
^TM



Re: William Rowe Jr. is now V.P., Apache HTTP Server

2009-07-16 Thread Mladen Turk

On 16/07/09 00:46, Roy T. Fielding wrote:


BE IT FURTHER RESOLVED, that William Rowe Jr. be and hereby is
appointed to the office of Vice President, Apache HTTP Server, to
serve in accordance with and subject to the direction of the Board of
Directors and the Bylaws of the Foundation until death,


Don't shoot the piano player :)


Congrats Bill
--
^TM



Re: Events, Destruction and Locking

2009-07-07 Thread Mladen Turk

Paul Querna wrote:


This deals with removing an event from the pollset, but what about an
event that had already fired, as I gave in the original example  of a
timeout event firing the same time a socket close event happened?



In that case I suppose the only solution is to make the operations
atomic. Since both operations would lead to the same result
(closing a connection) I suppose an atomic state flag should be enough.


In that state you have two threads both in a 'run state' for a
connection, and I'm not sure how the pre-cleanup to pools solves this
in any way?



It won't because the cleanup pool API doesn't bother with
cleanup callback return values, so there's no way to bail out
from the pool cleanup call. I suppose we could modify the
pre-cleanup to handle the retval from callback and breaks the
entire pool cleanup if one of them returns something other
then APR_SUCCESS. Then the callback function can decide
weather there is a pending close operation or not.


Regards
--
^(TM)


Re: Where Do I Create Queues in MPM Worker

2009-07-07 Thread Mladen Turk

ricardo13 wrote:


I want to modify MPM Worker (worker.c) to develop some scheduling
algorithms.

A first scheduling algorithm would be implement priority. Two queues
(worker_queue1 and worker_queue2) of sockets where threads (workers) get
all requests from worker_queue1 first, afterget all requests from
worker_queue2.



Now we are talking! You should explain that initially ;)


That is what I wanted to do.



I suppose each 'queue' would bind to a different listener,
otherwise this is a sort of throttling.
Since worker connection model is protocol independent and
if you wish a url/host based scheduling you cannot do that inside
worker since http protocol is handled after the worker handles
the connection. The only possible solution for a connection
scheduling would be scheduling a different connection pools
(eg. events on different listening socket)


Regards
--
^(TM)


Re: Where Do I Create Queues in MPM Worker

2009-07-06 Thread Mladen Turk

ricardo13 wrote:

Anyone ??



We are all on a vacation, sorry.




Hi all,

I would like to know how I create other queue of requests ?? Where I
create ?? worker.c ??



What in your terminology creation of other/another queue of requests.
The only thing I can think of is the ap_sub_req API declared in http_request.h
However, I somehow doubt we are using the same terminology.


Regards
--
^(TM)


Re: Events, Destruction and Locking

2009-07-06 Thread Mladen Turk

Paul Querna wrote:

Can't sleep, so finally writing this email I've been meaning to write
for about 7 months now :D

Pools don't help, but don't really make it worse, and are good enough
for the actual cleanup part -- the difficultly lies in knowing *when*
you can cleanup an object.



Pool pre cleanup is meant to deal with such issues.
You register a pre-cleanup and it will run before any of the
pool objects are actually destroyed.

In your case pre-cleanup callback could break the wait loop
and make sure you don't reference a zombie object.
The only issue left is guarding thread access to a singleton
pollset interrupt (we even have pollset_interrupt with latest APR)
from a pre-cleanup callback (or simply using a queue to serialize
the objects that needs to get removed from the pollset)

The exact problem we have/had with Tomcat native where shutting
down the server can lead to JVM crash in case the connections
are still in the pool waiting for the network event to happen.


Regards
--
^(TM)


Re: Creating a new thread inside a module

2009-07-01 Thread Mladen Turk

shaniro herath wrote:

Hi Iroshan and  All,

Same problem here. I passed function with infinite while loop when 
creating the thread . Thread creation is done inside a function of 
another module. But after call the module function thread also 
terminate. What are the steps that I have missed here.




Make sure you guys use the correct pool for thread creation.
The best is to use the child's main pool or to create
the child pool from it.


Regards
--
^(TM)


Re: Creating a new thread inside a module

2009-06-30 Thread Mladen Turk

William A. Rowe, Jr. wrote:

Mladen Turk wrote:

See asp_module_lock - this is entire windows specific;


I see. Nice trick.


you are right
that we don't have the API to pin the module in an apr-manner.  That
really shouldn't be all that hard to do, I'll look.  The register_hook
API seems to be the right place to usually do this.



I presume.
Perhaps adding something like ap_preloaded_modules table to which
the module can assign itself. But I presume there'll be and issue
with the pool used for LoadModule.


Regards
--
^(TM)


Re: Creating a new thread inside a module

2009-06-29 Thread Mladen Turk

h iroshan wrote:

Hi All,

I want to open a port to communicate my Apache hhtpd (2.2) with small 
software run on a separate machine .Without affecting the httpd how can 
i create a new thread to listen to that software.


Also I want to start this thread when the mod_proxy_balancer is 
initialize its balancer members(balancer_init).




Take a look at trunk's mod_watchdog.
It should compile with 2.2 without a problem.
However it requires to be statically compiled so it
can survive the child death.

If that's not feasible, hack it ;)


Regards
--
^(TM)


Re: Creating a new thread inside a module

2009-06-29 Thread Mladen Turk

h iroshan wrote:

Hi All
Actually I need *to* modify *Apache* and *run* one custom background 
*thread*. In addition, my custom modules have *to* be able *to* access 
the shared memory and it should be done through the background *thread*. 
Did anybody do this before? Is *there* an example I can use  as a 
starting point?


please help me.



I already told you to look at the trunk (mod_watchdog)
http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/core/

It is used to manage the hartbeat module at regular
intervals (you might look at this as well) and it
listens and send data via socket using shared memory extensively
and can manage mod_proxy (well should ;)

Regards
--
^(TM)


Re: Creating a new thread inside a module

2009-06-29 Thread Mladen Turk

William A. Rowe, Jr. wrote:

However it requires to be statically compiled so it
can survive the child death.


*That's* the reason for static?!?   See mod_aspdotnet and several
others for how to pin a particular .so module for the lifetime of
the process, instead of per-restart.



Why can't we make some simpler API for such modules instead
hacking the current one when it is obvious that there are
modules that cannot survive the graceful restart?


No modules in trunk should require static compilation, period.



There is a difference between should and must, but seems
to me there's no decent API for that.

Regards
--
^(TM)


Re: rotatelogs - Adding timeout for reading from stdin

2009-06-11 Thread Mladen Turk

William A. Rowe, Jr. wrote:

Mladen Turk wrote:

To clarify, it's no longer possible to pipe 'hugefile' through
rotatelogs with 1MB granularity.  This should at least be noted
in the docs if the patch is accepted.

Jim is traveling, it would be good to get his feedback Monday
on your proposed patch, because I'm near certain it's a puzzle
he had looked at.



OK. I've created BZ enhancement ticket:
http://issues.apache.org/bugzilla/show_bug.cgi?id=47345

Regards
--
^(TM)


Re: rotatelogs - Adding timeout for reading from stdin

2009-06-10 Thread Mladen Turk

William A. Rowe, Jr. wrote:

Mladen Turk wrote:

I'd leave rotatelogs alone, please.  Its design is not flawed.  But
I think Jim was working on something which would release the file
just as soon as its time is up, and that is useful across all of
the architectures, not windows specific.



Attached is the patch that uses 1 second timeout when reading
from stdin (hard-coded because we have 1 second rotation resolution).

Unfortunately I had to make WIN32 specific peace of code,
cause we don't have APR_FILES_AS_SOCKETS on that platform.

Code was testes both on windows and linux and it works like
a charm (rotation is done at exact time regardless of log events).


Regards
--
^(TM)
--- rotatelogs.c.org	2008-11-06 07:49:07.0 +0100
+++ rotatelogs.c	2009-06-10 14:15:39.0 +0200
@@ -44,6 +44,8 @@
 #include apr_file_io.h
 #include apr_file_info.h
 #include apr_general.h
+#include apr_poll.h
+#include apr_portable.h
 #include apr_time.h
 #include apr_getopt.h
 
@@ -64,6 +66,53 @@
 #define MAX_PATH1024
 #endif
 
+#if APR_FILES_AS_SOCKETS
+static apr_pollfd_t wait_pollfd;
+static apr_status_t wait_for_io_or_timeout(apr_file_t *f,
+   apr_interval_time_t timeout,
+   apr_pool_t *pool)
+{
+apr_int32_t  nd;
+
+if (!wait_pollfd.p) {
+wait_pollfd.p = pool;
+}
+wait_pollfd.desc_type = APR_POLL_FILE;
+wait_pollfd.reqevents = APR_POLLIN;
+wait_pollfd.desc.f= f;
+
+return apr_poll(wait_pollfd, 1, nd, timeout);
+}
+#elif defined(WIN32)
+static apr_status_t wait_for_io_or_timeout(apr_file_t *f,
+   apr_interval_time_t timeout,
+   apr_pool_t *pool)
+{
+HANDLE h;
+char   c;
+DWORD  r;
+ints = 0;
+
+apr_os_file_get(h, f);
+while (PeekNamedPipe(h, c, 1, r, NULL, NULL)) {
+if (r == 1)
+break;
+if (s = apr_time_msec(timeout))
+return APR_TIMEUP;
+Sleep(100);
+s += 100;
+}
+return APR_SUCCESS;
+}
+#else
+static apr_status_t wait_for_io_or_timeout(apr_file_t *f,
+   apr_interval_time_t timeout,
+   apr_pool_t *pool)
+{
+return APR_SUCCESS;
+}
+#endif /* APR_FILES_AS_SOCKETS */
+
 static void usage(const char *argv0, const char *reason)
 {
 if (reason) {
@@ -198,7 +247,18 @@
  * since we reset bypass_io after the 1st loop
  */
 if (!bypass_io) {
-if (apr_file_read(f_stdin, buf, nRead) != APR_SUCCESS) {
+apr_status_t rv;
+
+rv = wait_for_io_or_timeout(f_stdin, apr_time_from_sec(1), pool);
+if (rv == APR_SUCCESS) {
+if (apr_file_read(f_stdin, buf, nRead) != APR_SUCCESS) {
+exit(3);
+}
+}
+else if (APR_STATUS_IS_TIMEUP(rv)) {
+nRead = 0;
+}
+else {
 exit(3);
 }
 }


Re: rotatelogs - Adding timeout for reading from stdin

2009-06-10 Thread Mladen Turk

Dan Poirier wrote:

Would wait_for_io_or_timeout() be a good candidate for apr?



There is apr_wait_for_io_or_timeout but it uses the
apr_file_t-timeout which can be set only for pipes
and sockets.

Also the Win32 code will work only for stdhandles because
they are pipes.

In essence the answer is no.
However the full async file API is different thing...

Regards
--
^(TM)


Re: rotatelogs - Adding timeout for reading from stdin

2009-06-10 Thread Mladen Turk

Plüm, Rüdiger, VF-Group wrote:

Any particular reason why not using apr_wait_for_io_or_timeout
at least on unix?



See the answer I gave to Dan.
It uses file internal timeout which we cannot set, so no
it cannot be used.


Regards
--
^(TM)


Re: rotatelogs - Adding timeout for reading from stdin

2009-06-10 Thread Mladen Turk

William A. Rowe, Jr. wrote:

Mladen Turk wrote:

Code was testes both on windows and linux and it works like
a charm (rotation is done at exact time regardless of log events).


Foolish question, but rather than waking up every second, isn't it more
rational to compute the expiry of the current file and timeout for that
period of time?



Might be a nice add-on.
However it would require reorganizing the rotate logic to calculate
early instead late. This would complicate the patch and it
would be hard to follow the difference.
I've choose a straight forward approach.

Regards
--
^(TM)


rotatelogs - Adding timeout for reading from stdin

2009-06-09 Thread Mladen Turk

Hi,

Currently rotatelogs (at least on windows) holds the initial
log file by parent process (well it tries to rotate if something
is written from parent which is impossible for access logs).

I plan to use the apr_wait_for_io_or_timeout before calling
the apr_file_read(f_stdin, ...). This would give a chance
to parent to rotate his log as well and release the initial
log file descriptor.

Would that make any problems if executed in the parent?
Since apr_wait_for_io_or_timeout is posix only API, some
#ifdef _WIN32 would be required in rotatelogs


Regards
--
^(TM)


Re: rotatelogs - Adding timeout for reading from stdin

2009-06-09 Thread Mladen Turk

William A. Rowe, Jr. wrote:

Mladen Turk wrote:

Hi,

Currently rotatelogs (at least on windows) holds the initial
log file by parent process (well it tries to rotate if something
is written from parent which is impossible for access logs).

I plan to use the apr_wait_for_io_or_timeout before calling
the apr_file_read(f_stdin, ...). This would give a chance
to parent to rotate his log as well and release the initial
log file descriptor.

Would that make any problems if executed in the parent?
Since apr_wait_for_io_or_timeout is posix only API, some
#ifdef _WIN32 would be required in rotatelogs


Wouldn't it be better if we simply implement the mechanism to share
the same handle between the parent and child?


Since the parent does not receive any access log hits how
would that prevent it from holding that handle forever?



I'd leave rotatelogs alone, please.  Its design is not flawed.  But
I think Jim was working on something which would release the file
just as soon as its time is up, and that is useful across all of
the architectures, not windows specific.



Using 1 second wait before reading from the stdin would give
the required rotate resolution. In case of APR_TIMEUP it's
just a continue in the for (;;) loop giving change to rotate
logic to handle the files.

For Windows we can use apr_file_pipe_timeout_set(f_stdin, ...
Dunno if there's a bug in APR/win32, but you can actually always
set a timeout on a apr_file_t unlike on unix where this
is possible only if apr_file_t is a pipe.

And I would certainly like to hear from Jim what he proposes
for rotatelogs solution for holding the file handles in parent.


Regards
--
^(TM)


Re: rotatelogs - Adding timeout for reading from stdin

2009-06-09 Thread Mladen Turk

William A. Rowe, Jr. wrote:

Mladen Turk wrote:

Wouldn't it be better if we simply implement the mechanism to share
the same handle between the parent and child?

Since the parent does not receive any access log hits how
would that prevent it from holding that handle forever?


The parent's handle to the process would be the child's handle to the
process.  There would only be one rotatelogs process.



And I suppose this will work only with httpd trunk.

However I'll have to see the actual implementation
before making any conclusions.



And I would certainly like to hear from Jim what he proposes
for rotatelogs solution for holding the file handles in parent.


There should be no parent vs child question here.  The right fix is
one process, just as on unix.  Windows bubblegum and bailing wire is
the wrong fix.



Why? Timeout on reading from stdin is a nice and clean way for making the
rotation to happen even when there is no log entries fired that would
break the block on stdin. Rotation would always happen at midnight,
not at some random point of time in the future when something is written
to the log.

Regards
--
^(TM)


Re: rotatelogs - Adding timeout for reading from stdin

2009-06-09 Thread Mladen Turk

William A. Rowe, Jr. wrote:

Mladen Turk wrote:

Why? Timeout on reading from stdin is a nice and clean way for making the
rotation to happen even when there is no log entries fired that would
break the block on stdin. Rotation would always happen at midnight,
not at some random point of time in the future when something is written
to the log.


Yes!  And this is the point that I thought Jim was taking a look at, it
has nothing to do with Windows :)



Right, but it happens to help the Windows not holding
the files by the parent as a side effect ;)
It's a four liner patch, and I'll propose a patch anyhow,
so others might care to give it a peek and test.


Regards
--
^(TM)


Re: mod_proxy / mod_proxy_balancer

2009-05-05 Thread Mladen Turk

jean-frederic clere wrote:

Jim Jagielski wrote:


On May 5, 2009, at 4:45 AM, jean-frederic clere wrote:


Hi,

There are 2 weird things in the logic.
- In ap_proxy_add_worker_to_balancer() we make a copy of the worker, 
why not just the address?
If you looks to child_init() in mod_proxy and mod_proxy_balancer we 
see that mod_proxy initialise one copy and mod_proxy_balancer the 
other, it is working but one of the copies is never used.


- We want the child_init of mod_proxy before mod_proxy_balancer, that 
prevents reset() of the balancer_method to control the creation of 
the worker.




Yeah, all on target.




The next thing I am on is the ap_proxy_create_worker() called for 
reverse and forward (conf-reverse and conf-forward). 
ap_proxy_create_worker() fills the worker-id and they use 
ap_proxy_initialize_worker_share().e really need a shared information 
for those?




I already answered that to you ;)

The rest of the code doesn't differentiate the worker types,
so it is presumed that the worker has a share.
Sure you can use the malloc for the share, but then you will
have no track of data transfers on those workers.

May I ask why is that such a problem?


Regards
--
^(TM)


Re: what is in modules vs what is in the core

2009-03-31 Thread Mladen Turk

Paul Querna wrote:

mod_watchdog is the latest offender in a series of modules that expose
additional functions to the API. (mod_proxy and mod_cache do too!)



So, you came back from different direction, cool :)

If you really like to put the watchdog functionality
inside the mpm (and IMO that's all this about, sorry if I got
the wrong impression) then the mpm api needs to get
extended and implemented by *all* mpm's.



Are we just getting lazy, or does it not matter to anyone now days?



IIRC you wish to use the watchdog directly from simple mpm,
redesign the watchdog api  so that it can be used from
simple mpm at the first place, and leave to the others to
cope with the rest.

I would personally love to see the watchdog (actually
generic event ap_listener) functionality in the mpm's
core, and my first thing on the todo list is to extend
the mpm with child singleton hook. Just like we have
child_init we would have child_singleton_init hook but run
only for a single child, and run again once for the
next one when the previous dies. That way we would get
rid of all the singleton and startup mutex hacks, to
obtain something that is inherently known by the mpm.
However this needs to be implemented inside each and
every mpm if we wish to have any sort of the api.
Other solutions would be to simply move the
mod_watchdog to server/watchdog.c or that we all
just use the simple mpm :)


Regards
--
^(TM)


Re: mod_watchdog API, was Re: svn commit: r759751 - /httpd/httpd/trunk/modules/cluster/mod_heartbeat.c

2009-03-30 Thread Mladen Turk

Paul Querna wrote:

On Sun, Mar 29, 2009 at 10:44 PM, Paul Querna p...@querna.org wrote:

Inside a MPM that does it natively, just use the registered list of
providers, and implement the same behavoirs as the module.



The problem with mpm is that (IIRC the proposal) it uses
the current free resource. However if busy there will be no
resources available. So the solution is to dedicate a
separate resource for watchdog thread(s). Now, that's a
plain duplicate of mod_watchdog copied across the mpms.


Regards
--
^(TM)


Re: mod_watchdog API, was Re: svn commit: r759751 - /httpd/httpd/trunk/modules/cluster/mod_heartbeat.c

2009-03-30 Thread Mladen Turk

Paul Querna wrote:

On Mon, Mar 30, 2009 at 10:48 AM, Mladen Turk mt...@apache.org wrote:

Paul Querna wrote:

On Sun, Mar 29, 2009 at 10:44 PM, Paul Querna p...@querna.org wrote:

Inside a MPM that does it natively, just use the registered list of
providers, and implement the same behavoirs as the module.


The problem with mpm is that (IIRC the proposal) it uses
the current free resource. However if busy there will be no
resources available. So the solution is to dedicate a
separate resource for watchdog thread(s). Now, that's a
plain duplicate of mod_watchdog copied across the mpms.


fine, disagree with that, but what are your thoughts on switching to
the provider API?

I'd like to just implement it, but I don't want to do it and then get
yelled at..



Well if it'll allow multiple watchdog threads and parent
for non-forked mpm's, I have no problem with any API
you'll end up with :)

IMO all you need is to  split the single callback to
multiple one's. I don't think it's worth the effort,
but you're welcome.

Regards
--
^(TM)


Re: mod_watchdog API, was Re: svn commit: r759751 - /httpd/httpd/trunk/modules/cluster/mod_heartbeat.c

2009-03-30 Thread Mladen Turk

Jim Jagielski wrote:




fine, disagree with that, but what are your thoughts on switching to
the provider API?



+1 to provider... it's one of the best parts of httpd



But it uses the provider already :)

Regards
--
^(TM)


Re: svn commit: r759711 - /httpd/httpd/trunk/os/unix/unixd.c

2009-03-30 Thread Mladen Turk

Jim Jagielski wrote:

FWIW, this means that apr-1.4 is no longer viable for httpd-trunk.
As of a few days ago, I could build with 1.4.x no longer.

Are we *sure* we want to do that?



I was under the impression that apr-2 is now mandatory,
regardless of the apr-2 permission setter api.


Just asking :)



OK. It's not clear to me neither.

Regards
--
^(TM)


Re: svn commit: r759711 - /httpd/httpd/trunk/os/unix/unixd.c

2009-03-30 Thread Mladen Turk

Plüm, Rüdiger, VF-Group wrote:

IMHO we shouldn't require APR 2.0 for trunk (although trunk should be capable 
to run with 2.0).
Apart from the other stuff you mentioned before it makes it much harder to cut 
2.4.

So I am -1 on this change until APR 2.0 is at least in beta state.
So Mladen please revert.



OK, no problem.
I'm not at my dev machine right now, so you can do it
if not willing to wait for couple of hours.

Regards
--
^(TM)


Re: httpd -k start illegal option -- k

2009-03-29 Thread Mladen Turk

Ruediger Pluem wrote:


On 03/28/2009 08:11 PM, Mladen Turk wrote:

Current trunk gives the

$ ./httpd -k start
httpd: illegal option -- k

Is there some new config directive that needs
to be added since mpm redesign, or it's just
a temporary bug?


I guess it is bug that has something to do with
how ap_mpm_rewrite_args is now called.


Think that too.


Are you running on the latest trunk revision?


Yes, but just in case I did a completely clean
svn co for httpd and apr trunk

$ svn co http://svn.apache.org/repos/asf/httpd/httpd/trunk httpd
...
Checked out revision 759642.
$ cd httpd
$ svn co http://svn.apache.org/repos/asf/apr/apr/trunk srclib/apr
...
Checked out revision 759643.
$ ./buildconf
$ ./configure --with-layout=Apache --prefix=`pwd`/release/linux2 \
 --with-included-apr --enable-mods-shared=all --enable-pie \
 --enable-proxy --with-port=8000 --with-devrandom=/dev/urandom
$ make
(no errors, no warnings)
$ make install
$ cd release/linux2/bin
$ ./httpd -k start

Same thing (httpd: illegal option -- k)
Are u able to run it?

Regards
--
^(TM)


Re: httpd -k start illegal option -- k

2009-03-29 Thread Mladen Turk

Ruediger Pluem wrote:




$ ./httpd -k start
httpd: illegal option -- k


Is there some new config directive that needs
to be added since mpm redesign, or it's just
a temporary bug?


I guess it is bug that has something to do with
how ap_mpm_rewrite_args is now called.


Well they were not called at all.
I added the common ap_mpm_rewrite_args hook
to mpm modules table, so it runs now.

Somehow I wonder if that was Jeff's design idea.


Regards
--
^(TM)


Re: mod_watchdog API, was Re: svn commit: r759751 - /httpd/httpd/trunk/modules/cluster/mod_heartbeat.c

2009-03-29 Thread Mladen Turk

Paul Querna wrote:

On Sun, Mar 29, 2009 at 9:17 PM,  mt...@apache.org wrote:

Author: mturk
Date: Sun Mar 29 19:17:30 2009
New Revision: 759751

URL: http://svn.apache.org/viewvc?rev=759751view=rev
Log:
Use child singleton watchdog for running the heartbeat module

Modified:
   httpd/httpd/trunk/modules/cluster/mod_heartbeat.c


I'm looking at the API exposed by mod_watchdog.h, and its not quite
feeling right.

If we want this to be an API used easily, I think we should just make
them proper timers (ie, run function X in singleton in 10 seconds),
and when the timer finishes, it can re-register -- this is far more
flexiable, and in the long term the API could be taken over by MPMs
that can better support it.

WDYT?



There are actually two API's
The one I implemented for heartbeat is the simple one,
cause the heartbeat functionality is simple.

The second one is where you create a watchdog instance
with some interval and then it calls the provided
callback. If the callback return != 0 it's not
called any more. If you need a different interval,
change it by API call.

IMO having separate watchdogs is much better then
having one that will call multiple callbacks with
different timeouts because if one job blocks, others
will not execute.

BTW, we had this discussion few months back.

Regards
--
^(TM)


httpd -k start illegal option -- k

2009-03-28 Thread Mladen Turk

Current trunk gives the

$ ./httpd -k start
httpd: illegal option -- k

$ ./httpd -V
Server version: Apache/2.3.3-dev (Unix)
Server built:   Mar 28 2009 19:59:29
Server's Module Magic Number: 20090208:1
Server loaded:  APR 2.0.0-dev, APR-UTIL 2.0.0-dev
Compiled using: APR 2.0.0-dev, APR-UTIL 2.0.0-dev
Architecture:   32-bit
Server MPM: event
  threaded: yes (fixed thread count)
forked: yes (variable process count)
Server compiled with
 -D APACHE_MPM_DIR=server/mpm/event
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_SYSVSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=128
  ...

Is there some new config directive that needs
to be added since mpm redesign, or it's just
a temporary bug?


Regards
--
^(TM)


Re: moving towards loadable MPMs

2009-03-24 Thread Mladen Turk

Jeff Trawick wrote:


(no plans here to touch WinNT MPMs, and I don't see any compelling 
reason to leave it broken; it should build as before once the inevitable 
minor slips are corrected)




The major problem with that is the huge amount of platform
dependent code for managing the service, registry and fork.
(Although -k install and -k uninstall could be a separate
 utility app)

You could probably consider adding extra hooks that won't
do anything on *nix but would allow to easily plug the
NT mpm in this new layout.
If you go from the WinNT requirements, the *nix would fit
easily in this schema with just few no-ops for launching the
child process and sending the sockets, etc...


Regards
--
^(TM)


Re: moving towards loadable MPMs

2009-03-24 Thread Mladen Turk

Jeff Trawick wrote:
On Tue, Mar 24, 2009 at 12:41 PM, Mladen Turk mt...@apache.org 
mailto:mt...@apache.org wrote:


Jeff Trawick wrote:


(no plans here to touch WinNT MPMs, and I don't see any
compelling reason to leave it broken; it should build as before
once the inevitable minor slips are corrected)


The major problem with that is the huge amount of platform
dependent code for managing the service, registry and fork.
(Although -k install and -k uninstall could be a separate
 utility app)


Maybe its the lack of sleep, but I see that as a separate code reuse 
issue.  I'm not trying to address code reuse with this effort, except 
with minor details where the solution to cutting the ties to the MPM 
involves a shared definition.




Too bad then :)
I was hoping someone will address the separation of
child process management from the mpm.
Majority of this stuff is common and duplicated across
mpms while there can be an api for that thought.


Regards
--
^(TM)


Re: moving towards loadable MPMs

2009-03-24 Thread Mladen Turk

Paul Querna wrote:

I was hoping someone will address the separation of
child process management from the mpm.
Majority of this stuff is common and duplicated across
mpms while there can be an api for that thought.



Yes, the simple mpm inteded to go there, and only uses APR functions
for threadpools/fork/processes, rather than native OS functions like
the existing winnt/worker/prefork MPMs.



Well the problem is that apr isn't enough there.
Bill proposed to add registry (not sure about SCM)
code to the apr, but was rejected. There is
also a problem of sending the sockets to the child.
So one would still need the 'os' layer hooks where
os part of the mpm can do it's work.

Although good, the simple mpm isn't much of the
use solving that.

Like said earlier. You guys should start thinking
like a Windows developer :)


Regards
--
^(TM)


Re: [PATCH] fix recognition of APR 2.x

2009-03-08 Thread Mladen Turk

William A. Rowe, Jr. wrote:


If someone is shipping apr trunk, that's a big
mistake (theirs, not ours, we'll still ship the true apr 2.0 at some
point which will be grossly incompatible to such one-offs).

Part of this is the desire by Paul to move the project to scons.  I'm
prepared to merge the autoconf, but it's a bit more than an evening
project to combine apr and apr-util.  His hope was that scons is ready.



Just one question ...
What did you meant with combine apr and apr-util ?
Does it mean apr-util will cease to exist and become part of apr,
or you just commented the scons work

(Just when I mastered autoconf, here comes the python.
 What about something easier like lisp ;)

Regards
--
^(TM)


Re: [PATCH] fix recognition of APR 2.x

2009-03-02 Thread Mladen Turk

Jeff Trawick wrote:


I wouldn't be at all surprised if other folks are already using APR 
trunk with httpd trunk daily and I've missed something basic, so 
comments appreciated ;)




Right, I hand-crafted this, so you have my +1

Anyhow, what about making some release apr-2 dependent
so we can use apr-2 API. Don't think it's very smart
to #ifdef the code.


Regards
--
^(TM)


Re: Problems with EOS optimisation in ap_core_output_filter() and file buckets.

2009-02-17 Thread Mladen Turk

Graham Dumpleton wrote:

2009/2/17 Mladen Turk mt...@apache.org:

Graham Dumpleton wrote:

2009/2/17 Joe Orton jor...@redhat.com:

I did used to perform a dup, but was told that this would cause
problems with file locking. Specifically was told:

I'm getting lost here.  What has file locking got to do with it?  Does
mod_wscgi rely on file locking somehow?

I'm lost as well :)


Consider:

  fd1 = 

  lock(fd1)

  fd2 = dup(fd1)

  close(fd2) # will release the lock under some lock APIs even though
not last reference to underlying file object

  write(fd1) # lock has already been released so not gauranteed that only writer

  close(fd1)

At least that is how I understand it from what is being explained to
me and pointed out in various documentation.

So, if fd2 is the file descriptor created for file bucket in Apache,
if it gets closed before application later wants to write to file
through fd1, then application has lost its exclusive ownership
acquired by way of the lock and something else could have acquired
lock and started modifying it on basis that it has exclusive onwership
at that time.



Well, like said that won't work, neither is portable
(eg, apr_os_file_t is HANDLE on win32)

What you will need is the code that will take the Python
object and invoke Python file api feeding the apr_bucket.
(Basically writing the apr_bucket_python_file).

However the simplest thing might be an intermediate temp file, in
which case httpd could reference the file name not the file
object itself. Not sure how woule that work with dynamic file
since apr and python might use different platform locking
mechanisms.

Regards
--
^(TM)


Re: Problems with EOS optimisation in ap_core_output_filter() and file buckets.

2009-02-16 Thread Mladen Turk

Graham Dumpleton wrote:

2009/2/17 Joe Orton jor...@redhat.com:

I did used to perform a dup, but was told that this would cause
problems with file locking. Specifically was told:



I'm getting lost here.  What has file locking got to do with it?  Does
mod_wscgi rely on file locking somehow?




I'm lost as well :)



In WSGI applications, it is possible for the higher level Python web
application to pass back a file object reference for the response with
the intent that the WSGI adapter use any optimised methods available
for sending it back as response. This is where file buckets come into
the picture to begin with.



Now it looks that you are trying to intermix the third party
maintained native OS file descriptors and file buckets.
You can create the apr_file_t from apr_os_file_t
(Think you'll have platform portability issues there)
but the major problem would be to ensure the life cycle
of the object, since Python has it's own GC and httpd has
it's pool.
IMHO you will need a new apr_bucket provider written in
Python and C for something like that.


Regards
--
^(TM)


Re: svn commit: r741947 - in /httpd/httpd/trunk/modules/mappers: config9.m4 mod_watchdog.c mod_watchdog.h

2009-02-08 Thread Mladen Turk

Ruediger Pluem wrote:



+}
+if (w-is_running  w-callbacks == NULL) {
+/* This is hook mode watchdog
+ * running on WatchogInterval
+ */
+w-step += (apr_time_now() - curr);
+if (w-step = wd_interval) {
+if (!ctx)
+apr_pool_create(ctx, w-pool);


Is this check really needed? ctx should be always NULL here.



Yes, it's NULL, but only for the first callback.
If there are multiple callbacks they will all use
the same pool for this call.
Also, pool gets created only if one of the callbacks
actually times out.


+
+/* This mutex fixes problems with a fast start/fast end, where the pool
+ * cleanup was being invoked before the thread completely spawned.
+ */


Can you elaborate this a bit more (maybe with an example)?
I currently do not understand which problem is solved here.



Well, I reused the mod_heartbeat code here, and I think it's
very useful to ensure the thread actually gets created and
running before we allow to kill the child.


+apr_thread_mutex_lock(w-startup);
+
+/* Start the newly created watchdog */
+rc = apr_thread_create(w-thread, NULL, wd_worker, w, p);
+if (rc) {
+apr_pool_cleanup_kill(p, w, wd_worker_cleanup);


I don't see that this cleanup gets registered anywhere.



That got slipped during copy/paste from my dev branch.
Fixed, thanks.


Regards
--
^(TM)


  1   2   3   4   5   >