Drupal érdekesség - locking system

  • 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

With havin so much content do

With havin so much content do you ever run into any problems of plagorism or copyright violation? My site has a lot of unique content I've either authored myself or outsourced but it looks like a lot of it is popping it up all over the internet without my permission. Do you know any methods to help reduce content from being ripped off? I'd definitely appreciate it.|

We stumbled over here

We stumbled over here different web address and thought I may as
well check things out. I like what I see so now i am
following you. Look forward to looking over your web page yet again.

Hello Dear, are you truly

Hello Dear, are you truly visiting this web page on a regular basis, if so after that you
will without doubt take fastidious know-how.

You actually make it appear

You actually make it appear so easy with your presentation however I in finding this topic to be really one
thing which I think I'd by no means understand.
It sort of feels too complex and extremely broad for me.

I am having a look ahead in your next publish, I'll attempt to get the cling
of it!

Post writing is also a fun,

Post writing is also a fun, if you be familiar with then you can write if not it is complex
to write.

Hello There. I found your

Hello There. I found your blog using msn.
This is a really well written article. I will be
sure to bookmark it and come back to read more of your useful info.
Thanks for the post. I'll definitely comeback.

Thanks for finally writing

Thanks for finally writing about >Válasz a hozzászólásra

These are actually impressive

These are actually impressive ideas in about blogging.
You have touched some pleasant things here. Any way keep up wrinting.

Attractive part of content. I

Attractive part of content. I just stumbled upon your blog and
in accession capital to claim that I get actually
enjoyed account your blog posts. Anyway I'll be subscribing
on your augment and even I fulfillment you access persistently quickly.

Very soon this web site will

Very soon this web site will be famous amid all blogging and site-building viewers,
due to it's nice content

Nice replies in return of

Nice replies in return of this difficulty with solid arguments and describing all concerning that.

Greetings from Carolina! I'm

Greetings from Carolina! I'm bored at work so I decided
to browse your blog on my iphone during lunch break.
I love the knowledge you present here and can't wait to take a look when I get home.
I'm amazed at how fast your blog loaded on my
mobile .. I'm not even using WIFI, just 3G ..

Anyways, superb blog!

Very good post! We are

Very good post! We are linking to this great post on our website.

Keep up the great writing.
Jay's Santa Clarita Tree Removal Kings
26174 Las Lanas Ct, Santa Clarita, CA 91355
661-464-1270
laureljefferson09875 [at] gmail [dot] com

I'm really impressed with

I'm really impressed with your writing skills and also
with the layout on your blog. Is this a paid theme or did you customize it yourself?
Anyway keep up the nice quality writing, it's rare to see a nice blog like this one nowadays.

It's an awesome post for all

It's an awesome post for all the web visitors; they will take benefit from it I am sure.

Nice post. I used to be

Nice post. I used to be checking constantly this blog and I am impressed!
Extremely helpful information particularly the last section :) I deal with such information a lot.
I was seeking this particular information for a long time.
Thanks and best of luck.

Hi, I do think this is an

Hi, I do think this is an excellent web site.
I stumbledupon it ;) I am going to come back yet again since I saved as a favorite
it. Money and freedom is the best way to change,
may you be rich and continue to guide others.

I used to be recommended this

I used to be recommended this website by means of my cousin. I'm
no longer certain whether or not this put up is written by way of him as
nobody else recognize such certain approximately my problem.
You're incredible! Thanks!

Have you ever considered

Have you ever considered publishing an ebook or guest authoring on other websites?
I have a blog based on the same topics you discuss and would love to have you
share some stories/information. I know my viewers would appreciate your work.

If you are even remotely interested, feel free
to shoot me an email.

Awesome post.

Awesome post.

Pretty section of content. I

Pretty section of content. I just stumbled upon your web site
and in accession capital to assert that I acquire
actually enjoyed account your blog posts. Any way I will be subscribing to your feeds and
even I achievement you access consistently quickly.

This is a really good tip

This is a really good tip particularly to those fresh to the blogosphere.
Brief but very precise info… Many thanks for sharing this one.
A must read article!

Why people still make use of

Why people still make use of to read news papers when in this technological globe all is existing on net?

Wow that was odd. I just

Wow that was odd. I just wrote an extremely long comment but after I clicked submit
my comment didn't show up. Grrrr... well I'm not writing
all that over again. Anyways, just wanted to say excellent
blog!

I am sure this post has

I am sure this post has touched all the internet viewers, its really really good piece of writing
on building up new weblog.

I just could not leave your

I just could not leave your site prior to suggesting that I extremely
enjoyed the standard info a person supply in your visitors?
Is going to be again often in order to check
out new posts

Excellent article! We are

Excellent article! We are linking to this particularly
great content on our site. Keep up the good writing.

I love what you guys tend to

I love what you guys tend to be up too. Such clever work
and exposure! Keep up the superb works guys I've added you guys to my own blogroll.

These are in fact enormous

These are in fact enormous ideas in about blogging.
You have touched some fastidious factors here. Any way keep up wrinting.

Hey there! This is kind of

Hey there! This is kind of off topic but I need some help from an established blog.
Is it very hard to set up your own blog? I'm not very techincal but
I can figure things out pretty quick. I'm thinking about making my own but I'm not sure where to start.
Do you have any ideas or suggestions? Many thanks

I think this is one of the

I think this is one of the most important info for me. And i am glad reading your article. But should remark on some general things, The site style is wonderful, the articles is really nice : D. Good job, cheers|

This design is steller! You

This design is steller! You certainly know how
to keep a reader entertained. Between your wit and your videos, I was almost
moved to start my own blog (well, almost...HaHa!) Great job.
I really enjoyed what you had to say, and more than that,
how you presented it. Too cool!

Thanks to my father who

Thanks to my father who stated to me concerning this
website, this webpage is really amazing.

I'll immediately take hold of

I'll immediately take hold of your rss as I can not
in finding your e-mail subscription hyperlink or e-newsletter service.
Do you've any? Kindly allow me recognise so that I could subscribe.

Thanks.

Why viewers still use to read

Why viewers still use to read news papers when in this technological world everything is accessible on net?

Jim's San Jose Carpet Cleaning
780 S 3rd St, San Jose, CA 95112
3408-351-1063
colettemackie2641 [at] gmail [dot] com

Very quickly this site will

Very quickly this site will be famous among all blogging and site-building users, due to it's good articles

Why users still use to read

Why users still use to read news papers when in this technological globe everything is
existing on web?

Howdy! I could have sworn

Howdy! I could have sworn I've been to this blog before but after browsing through many of the articles
I realized it's new to me. Nonetheless, I'm definitely
delighted I found it and I'll be book-marking it and checking back frequently!

Hey I am so happy I found

Hey I am so happy I found your website, I really found you
by mistake, while I was searching on Askjeeve for something else, Regardless I
am here now and would just like to say many thanks for
a remarkable post and a all round exciting blog (I also love the theme/design), I don't have time
to look over it all at the minute but I have bookmarked
it and also added in your RSS feeds, so when I have time I will be back to read more, Please do keep up the
superb job.

It's the best time to make

It's the best time to make some plans for the long run and it is time to be happy.
I have learn this post and if I could I wish to
suggest you few fascinating things or suggestions.
Perhaps you could write subsequent articles relating to this article.

I want to learn more things approximately it!

Peculiar article, exactly

Peculiar article, exactly what I wanted to find.

If some one wants expert view

If some one wants expert view concerning blogging after that
i propose him/her to pay a quick visit this website, Keep up the good job.

Valuable info. Lucky me I

Valuable info. Lucky me I found your site accidentally, and I'm
stunned why this coincidence didn't happened earlier!
I bookmarked it.

My relatives all the time say

My relatives all the time say that I am wasting my time here at web, except I know I am getting knowledge everyday by reading thes good articles.

Magnificent beat ! I would

Magnificent beat ! I would like to apprentice while you amend your website, how could
i subscribe for a blog website? The account helped me a acceptable deal.
I had been tiny bit acquainted of this your broadcast provided bright clear
concept

Wonderful beat ! I would like

Wonderful beat ! I would like to apprentice while you amend your web
site, how can i subscribe for a blog web site? The account aided me a
acceptable deal. I had been a little bit acquainted of this your broadcast offered bright
clear idea

Hello there, just became

Hello there, just became aware of your blog through Google,
and found that it is truly informative. I'm going to watch out for brussels.
I will be grateful if you continue this in future. Lots of people will be benefited from your writing.
Cheers!

I'm not sure why but this

I'm not sure why but this website is loading incredibly slow for me.
Is anyone else having this issue or is it a issue on my end?
I'll check back later and see if the problem still exists.

I delight in, cause I found

I delight in, cause I found exactly what I used to be taking a look for.
You've ended my 4 day long hunt! God Bless you man. Have a great
day. Bye

I'll immediately take hold of

I'll immediately take hold of your rss feed
as I can not to find your email subscription link or newsletter service.

Do you've any? Kindly let me recognize so that I may just subscribe.
Thanks.

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.