Drupal érdekesség - locking system

  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • The spam filter installed on this site is currently unavailable. Per site policy, we are unable to accept new submissions until that problem is resolved. Please try resubmitting the form in a couple of minutes.
Kategória: 
Leírás

Vannak a Drupalnak amolyan rejtett dolgai, az ember ritkán találkozik velük, sőt, esetleg nem is tudjuk, hogy létezik. Na egy ilyet szedek elő, bevallom, én is ma találkoztam vele először. Ez pedig a locking system, magyarul talán zárolási rendszer a randa szó rá, de becézhetjük szemafornak is.

De mit is csinál ez? Vannak a drupalban olyan folyamatok, amikből nem árt, hogyha nem indul el ugyanazon paraméterekkel kettő. Tipikusan ilyen drupal folyamat a cron, illetve a batch.

Biztosan találkoztál már olyannal a naplóban, hogy "Attempting to re-run cron while it is already running.", magyarul ilyesmi, hogy a "Cron futása nem lehetséges, mert már fut".

Ilyenkor az történik, hogy a hogy amikor elindul egy cron folyamat, egy zárolási rekord keletkezik a semaphore táblában. Ez a lock_acquire($name) függvány hívására történik. Amikor cron futás közben újabb cron indul, történik egy ellenőrzés, hogy a 'cron' nevű zárolás létezik-e már, és ha igen, akkor nem indul el az újabb cron, illetve akkor keletkezik a naplóban az emlegetett bejegyzés.

A lock státuszát mi is lekérdezhetjük: lock_may_be_available('cron').

Amikor az első cron véget ért, akkor történik a zárolás feloldása a lock_release('cron') függvény hívásával.

Mire jó ez még a gyakorlatban?
Nem néztem meg, de például a views is igen valószínű, hogy ez alapján zárolja a nézetek szerkesztési felületét. Ilyenkor van az, hogy "A nézet nem szerkeszthető, mert egy másik felhasználó zárolta", vagy valami ilyesmi..

Van egy éppen aktuális téma a drupal.hu-n, a kolléga egy másik adatbázist írna drupal felületen keresztül. Nos, én bizony preventív nem biztos, hogy szívesen hagynám, hogy egyszerre többen ugyanazt a rekordot szerkesszék. Tehát a szerkesztő form generálása során csinálnék egy lock_acquire("mylock_$recordid"); -t, a form beküldése után pedig lock_release("mylock_$recordid").

És aminek a kapcsán én találkoztam ma a locking system-el, az a boost modul. Észrevettem, hogy ha kell, ha nem, törlődnek a boost által létrehozott oldalak minden cron futáskor. Ennek az oka pedig a locking system "nem ismerete" volt. A modul fejlesztője egy egészen más vonalon oldotta meg a dolgot, ami sok esetben nem működik.
Az eset másik tanulsága: Hogy sokféleképpen meg lehet oldani egy feladatot, de ha azt nem "drupalosan" teszed, akkor bizony érhetnek meglepetések.

Hozzászólások

Monetary advisors business is

Monetary advisors business is folks enterprise.

I am regular reader, how are

I am regular reader, how are you everybody? This post posted at this web page
is actually fastidious.

Howdy! I could have sworn

Howdy! I could have sworn I've been to this website before but after browsing through some of the post I realized it's new to me.
Anyways, I'm definitely happy I found it and I'll be bookmarking and checking back frequently!

I love your blog.. very nice

I love your blog.. very nice colors & theme. Did you
design this website yourself or did you hire someone
to do it for you? Plz respond as I'm looking to construct my own blog and would like to know where
u got this from. thanks

Feel free to surf to my website ... dyson dc24

I enjoy reading a post that

I enjoy reading a post that will make men and women think.
Also, thanks for permitting me to comment!

cresign. mothercenter.

Hi mates, how is the whole

Hi mates, how is the whole thing, and what you would like to say on the topic of this post, in my view its in fact awesome designed for
me.

anapa-alrosa. deryun.

I need to to thank you for

I need to to thank you for this wonderful
read!! I definitely enjoyed every bit of it. I have
you book-marked to look at new stuff you post…

Hello! This post couldn't be

Hello! This post couldn't be written any better!
Reading through this post reminds me of my previous room mate!
He always kept talking about this. I will forward this write-up to
him. Pretty sure he will have a good read. Many thanks for sharing!

my site - dyson dc24

Investors do pay direct and

Investors do pay direct and oblique costs.

I really like what you guys

I really like what you guys are usually up too. This kind
of clever work and coverage! Keep up the good works guys I've added you guys to my blogroll.

smdservicesllc.

It's in fact very complex in

It's in fact very complex in this full of activity life
to listen news on TV, so I only use internet for that
reason, and obtain the most recent information.

We are a group of volunteers

We are a group of volunteers and starting a new scheme in our community.
Your website provided us with valuable information to work
on. You've done an impressive job and our entire community will be grateful to you.

my blog post freeman dyson

If some one wants expert view

If some one wants expert view regarding blogging afterward i recommend him/her to pay a visit this website, Keep up the pleasant job.

classipage. aurum32.

I savor, result in I

I savor, result in I discovered exactly what I was taking a look for.

You've ended my 4 day lengthy hunt! God Bless you man. Have a nice day.
Bye

topdiffusion.

Excellent article. I will be

Excellent article. I will be going through many of
these issues as well..

First off I would like to say

First off I would like to say awesome blog! I had a quick question which I'd like to ask if you do not mind.

I was curious to find out how you center yourself and clear your thoughts before writing.
I have had trouble clearing my mind in getting my ideas out there.
I truly do take pleasure in writing however it just seems like the first 10 to 15 minutes tend to be
wasted simply just trying to figure out how to begin. Any suggestions or hints?
Kudos!

my web site: drugs online

Normally I do not read

Normally I do not read article on blogs, however I would like to say that this write-up very
forced me to take a look at and do it! Your writing style has been surprised me.
Thanks, very great article.

miami-limo-services. ttlink.

smertforum. nevershutdown.

Does your website have a

Does your website have a contact page? I'm having a tough time locating it but, I'd like to send you an e-mail.
I've got some suggestions for your blog you might
be interested in hearing. Either way, great blog and
I look forward to seeing it improve over time.

Hello There. I found your

Hello There. I found your blog using msn. This is an extremely well written article.
I'll be sure to bookmark it and come back to read
more of your useful information. Thanks for the
post. I'll definitely return.

Feel free to surf to my blog :: prescription medicines

You actually make it appear

You actually make it appear really easy with your presentation but I in finding
this matter to be actually something which I think I'd never understand.

It seems too complicated and extremely large for me. I am taking a look forward in your subsequent publish,
I will attempt to get the grasp of it!

smdservicesllc.

You're so interesting! I

You're so interesting! I don't suppose I've
read something like this before. So good to discover another
person with some genuine thoughts on this subject. Seriously..
thanks for starting this up. This website is something that
is needed on the internet, someone with some originality!

insidefilms. adopt10plus.

Hello there! I could have

Hello there! I could have sworn I've been to this website before but
after looking at a few of the posts I realized it's new to
me. Anyways, I'm definitely pleased I found it and I'll be book-marking it
and checking back often!

js-pcb. azatweb.

Wow, marvelous blog

Wow, marvelous blog structure! How long have you ever been running
a blog for? you make running a blog glance easy. The overall glance of your site is excellent, let alone
the content!

I'm not sure where you're

I'm not sure where you're getting your info, but great
topic. I needs to spend some time learning more or understanding more.
Thanks for fantastic information I was looking for this
information for my mission.

Also visit my web site ... buy cialis canada online

Does your website have a

Does your website have a contact page? I'm having a
tough time locating it but, I'd like to shoot you an e-mail.
I've got some creative ideas for your blog
you might be interested in hearing. Either way, great site and
I look forward to seeing it grow over time.

xn---1-6kcatagi3d. neoham.

When some one searches for

When some one searches for his required thing, thus he/she desires
to be available that in detail, therefore that thing is maintained
over here.

peymankala. houseyorgrim.

Thank you for the auspicious

Thank you for the auspicious writeup. It in reality used to be a entertainment account it.

Glance complex to more delivered agreeable from you!

By the way, how can we be in contact?

Its such as you read my

Its such as you read my thoughts! You seem to know a lot about this,
such as you wrote the ebook in it or something. I think
that you just can do with a few p.c. to drive the message house a bit,
however other than that, that is magnificent blog.

A fantastic read. I will definitely be back.

Here is my web site: how to buy cialis online from canada

What's up to all, the

What's up to all, the contents present at this web page are truly awesome for
people experience, well, keep up the nice work fellows.

rayanwebhost. sunyudo.

What's up to all, because I

What's up to all, because I am in fact keen of reading this web
site's post to be updated on a regular basis. It consists of pleasant
material.

langroud118. ankorona.

I'm really inspired together

I'm really inspired together with your writing talents and also with the
structure to your weblog. Is this a paid subject or did you customize it your self?

Anyway stay up the excellent quality writing,
it's uncommon to look a nice weblog like this one these days..

What's up, this weekend is

What's up, this weekend is fastidious for me, since this time i
am reading this fantastic informative piece of writing
here at my home.

Look at my weblog cialis over the counter

Hello just wanted to give you

Hello just wanted to give you a brief heads up and let you know
a few of the pictures aren't loading correctly. I'm not sure why
but I think its a linking issue. I've tried it in two different web browsers and both show
the same results.

dhc2016. maplelost.

Great beat ! I would like to

Great beat ! I would like to apprentice even as you amend your
site, how could i subscribe for a blog website? The account
aided me a appropriate deal. I were a little bit familiar of this your broadcast offered brilliant transparent idea

Hozzászólás

A mező tartalma nem nyilvános.
  • Internal paths in double quotes, written as "internal:node/99", for example, are replaced with the appropriate absolute URL or relative path.
  • Engedélyezett HTML elemek: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <del> <img>
  • A webcímek és email címek automatikusan linkekké alakulnak.
  • A sorokat és bekezdéseket a rendszer automatikusan felismeri.
  • Engedélyezett HTML elemek: <a> <blockquote> <br> <cite> <code> <dd> <del> <div> <dl> <dt> <em> <li> <ol> <p> <span> <strong> <ul>
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <bash>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <mysql>, <php>, <python>, <ruby>, <sql>. The supported tag styles are: <foo>, [foo].
  • Minden email cím át lesz alakítva ember által olvasható módon, vagy (ha a JavaScript engedélyezett) ki lesz cserélve kattintható, de biztonságos hivatkozásra.