You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2010/12/04 05:35:59 UTC

DO NOT REPLY [Bug 50410] New: Poll.create with THREADSAFE will silently switch the flag off

https://issues.apache.org/bugzilla/show_bug.cgi?id=50410

           Summary: Poll.create with THREADSAFE will silently switch the
                    flag off
           Product: Tomcat Native
           Version: 1.1.20
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Library
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: costin@apache.org


If apr returns APR_ENOTIMPL the JNI code will just turn the flag off. 
I couldn't find any way for java side to find if the create poll was or was not
threadsafe. 

There are 2 options to fix it: 
- throw an exception - seems the right thing to do, java can do the fallback
- consistent with 'wakeable' - add a field and a method to check if it's on. 

It seems Tomcat code is not using the flag, not sure why - I would go with the
first option.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 50410] Poll.create with THREADSAFE will silently switch the flag off

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50410

Mladen Turk <mt...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WONTFIX

--- Comment #1 from Mladen Turk <mt...@apache.org> 2011-01-07 06:10:48 EST ---
This is APR's wrongly designed API.
No mater if the native OS pollset implementation is thread safe
or not, if APR_POLLSET_THREADSAFE is not provided internal
mutex will be created. However if required create will fail
and we would need to call that API again.
If not required beside creating unneeded mutex what's worse
it's be used although not required, so it's clear why
we wish too call it with that flag.

However from the end user (tomcat native) point of view
this makes no difference at all.
What we do internally is to clear that flag and try again
without that flag, fixing the APR api which should
treat APR_POLLSET_THREADSAFE as a 'hint' not as a requirement.

Whether native pollset implementation is thread safe or not
makes no real value because if it's not APR will create
internal mutex protecting it, so this is just one
of those "legacy" api's.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org