[
https://issues.apache.org/jira/browse/THRIFT-21?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12599933#action_12599933
]
David Reiss commented on THRIFT-21:
-----------------------------------
I Googled around for this a bit and found this
<http://books.google.com/books?id=tdsZHyH9bQEC&pg=PA785&dq=thread-safe+accept&ei=DlA7SNbbH4PitgPN2tmdAw&client=firefox-a&sig=AnRQunQLb4lcMvlxiCVI-HvjijA>,
which states that accept is defined to be thread-safe (which I verified) but
that not all OSes comply with this (which I did not verify). If anyone can
find an example of an OS that we want to support that does not provide a
thread-safe accept, I think we should consider implementing a workaround.
> TThreadPoolServer has dangerous thread-safety issue in accepting connections
> ----------------------------------------------------------------------------
>
> Key: THRIFT-21
> URL: https://issues.apache.org/jira/browse/THRIFT-21
> Project: Thrift
> Issue Type: Bug
> Components: Library (Ruby)
> Reporter: Kevin Ballard
>
> TThreadPoolServer currently accepts incoming connections in threads. This
> means that at any time, as long as the thread pool is not completely full of
> running connections, there are multiple threads currently blocking on the
> #accept call. This is dangerous because the accept syscall is not documented
> as being thread-safe. The only reason this actually works in ruby is because
> of the cooperative threading, but if this library is used in any ruby
> interpreter that supports native threads (e.g. MacRuby, jruby, etc) I would
> expect it to start manifesting strange bugs.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.