lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler (JIRA)" <j...@apache.org>
Subject [jira] Commented: (LUCENE-2834) don't spawn thread statically in FSDirectory on Mac OS X
Date Mon, 27 Dec 2010 09:57:45 GMT

    [ https://issues.apache.org/jira/browse/LUCENE-2834?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12975223#action_12975223
] 

Uwe Schindler commented on LUCENE-2834:
---------------------------------------

Hi Robert,

patch looks theoretically fine, although I dislike the code duplication and the duplication
of temp file code.

I dont understand the whole problem why you care of this additional thread. Just put this
thread name on the rogue list and we are fine. The badest thing is interrupting this thread
for no reason. The PKCS thread is generated on MacOSX, because its underlying security system
is different from Windows or Linux. On Windows and MacOSX the PKCS system uses the trusted
root certificates from the operating system and it seems that on MacOSX this needs some thread
to handle the OS' PKCS library. Its as stupid as killing processes on Android phones as recreating
them uses more resources than keep them running. If you start to kill this thread you can
also kill all GC threads just for fun :-)

The reason why serialization starts the thread: Serialization uses hashing, too :-) - The
PKCS thread is for me just a system thread with the difference that its started lazily when
first accessed.

One thing: I don't like the empty catch blocks /* cannot happen */. Even if this is the case,
please throw at least a RuntimException. Some user may stiull use a broken JVM where the charsets.jar
file is lost :-) (ok, that should not happen, but I like it more to have that).

+1 for the UTF-8 fix (this will not break most lock file names, as filenames and hopefully
index dir pathes are mostly ASCII)
-1 for MD5Digest code duplication
-1 for the temp file code dumplication

My opinion:
Lazy init the static MessageDigest class in FSDirectory. Its almost never used.

Will post an alternative patch soon (lazy init MessageDigest only when needed first, add fixed
UTF-8 charset).

> don't spawn thread statically in FSDirectory on Mac OS X
> --------------------------------------------------------
>
>                 Key: LUCENE-2834
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2834
>             Project: Lucene - Java
>          Issue Type: Bug
>            Reporter: Robert Muir
>             Fix For: 3.1, 4.0
>
>         Attachments: LUCENE-2834.patch
>
>
> on the Mac, creating the digester starts up a PKCS11 thread.
> I do not think threads should be created statically (I have this same issue with TimeLimitedCollector
and also FilterManager).
> Uwe discussed removing this md5 digester, I don't care if we remove it or not, just as
long as it doesn't create a thread,
> and just as long as it doesn't use the system default locale.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


Mime
View raw message