Re: kadmin incremental propagation full resync multiple processes spawned

On 11/4/2011 1:40 PM, Tom Yu wrote:

I think it should be possible to do something using alarm() to provide
timeouts for lock acquisition, but that wouldn't work well inside a

As I understand it, the issue is that there is no "get a lock, wait in line if it's not available" call. If such a call did exist, it would need a timeout value to limit how long it would wait. But the current call simply returns immediately, either with the lock, or without it. If you didn't get it, your only choice is to try and get it again. However, if it does become free, there's nothing keeping someone else from jumping in and grabbing it before you have the chance to try again. The current approach tries five times with a 1 second delay in between tries to get the lock, then gives up. If somebody else (in this case kadmind) is also busily grabbing the lock, and sitting on it, the odds of you getting in to get it aren't necessarily that good.

Barring a better lock API, the only other little choice is to try more times and perhaps wait less in between tries. I suppose you could spin on it, continuously trying to get the lock for a certain interval, but that would be a bit inefficient.

Paul B. Henson | (909) 979-6361 |
Operating Systems and Network Analyst | henson@xxxxxxxxxxxxx
California State Polytechnic University | Pomona CA 91768

Relevant Pages

  • Re: pthread_mutex_trylock vs. pthread_mutex_lock
    ... collect ownership info and put in timeouts to expose ... likely to own the lock. ... question to put in instrumentation that will routinely report ... the current time is less overhead ...
  • Re: Should COBOL be lockedUP for good?...
    ... Windows had demonstrated that if a client ... I don't think that 'Timeouts' are sensible. ... why I would want to lock a record for some hours, ...
  • Re: New "timeout" api, to replace callout
    ... only ever grab the specified lock when it calls the timeout function. ... My plan is to use non-blocking grabs of the timeouts lock to get ...
  • Distributor Lock Timeouts
    ... timeouts to any specific activity or activity levels. ... timeouts I also see a spike in lock requests, ... replication latency seems to stay about the same. ... whenever I fire up Replication Monitor the lock timeouts increase ...
  • Re: Thread#raise, Thread#kill, and timeout.rb are unsafe
    ... before entering it), so that timeouts can end properly. ... stopped thread is using (imagine a thread stopped halfway through ... releasing a lock that the ensure block needs to acquire, ...