Drupal érdekesség - locking system

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

Hi there, all is going nicely

Hi there, all is going nicely here and ofcourse every one is sharing data, that's actually fine, keep up writing.|

My spouse and I stumbled

My spouse and I stumbled over here by a different web address and thought I might check things out. I like what I see so i am just following you. Look forward to finding out about your web page yet again.|

Exceptional post but I was

Exceptional post but I was wondering if you could write
a litte more on this subject? I'd be very grateful if you could elaborate a little bit further.
Appreciate it!

Its like you read my mind!

Its like you read my mind! You seem to know a lot about this, like you wrote the book in it
or something. I think that you can do with a few pics to drive the message home a little bit,
but other than that, this is excellent blog. A great read.
I'll certainly be back.

Hello There. I found your

Hello There. I found your weblog the use of msn. That is a really neatly
written article. I'll be sure to bookmark it
and come back to read more of your helpful info.
Thank you for the post. I'll definitely comeback.

Thank you for sharing your

Thank you for sharing your thoughts. I really appreciate your efforts and I will be waiting for your next post thanks once again.

I always used to read article

I always used to read article in news papers but now as I
am a user of internet therefore from now I am using net for posts, thanks to web.

When someone writes an post

When someone writes an post he/she maintains the image of a user in his/her mind that how a user
can know it. Therefore that's why this article is great.

Thanks!

Every weekend i used to pay a

Every weekend i used to pay a visit this web site, as i want enjoyment, since this this site conations really nice funny material too.|

Your mode of describing all

Your mode of describing all in this paragraph is genuinely fastidious, all be able to effortlessly understand it, Thanks a lot.|

I know this site provides

I know this site provides quality depending posts
and extra stuff, is there any other web site which presents these things
in quality?

We're a group of volunteers

We're a group of volunteers and starting a new scheme in our community.
Your web site offered us with valuable information to work on. You have done an impressive job and our
entire community will be grateful to you.

Excellent blog you've got

Excellent blog you've got here.. It's hard to find excellent writing like yours nowadays. I seriously appreciate individuals like you! Take care!!|

Do you have a spam problem on

Do you have a spam problem on this blog; I also am a blogger, and I was wanting to know your situation; many of us have developed some nice methods and we are looking to trade strategies with others, why not shoot me an email if interested.|

Read lots of usefull tips and

Read lots of usefull tips and trick how to win on online casino here :

https://www.bbd.casino/info_details/cara-menang-baccarat

https://www.bbd.casino/info_details/how-to-register

https://www.bbd.casino/info_details/how-to-deposit

https://www.bbd.casino/info_details/how-to-withdraw

https://www.bbd.casino/info_details/how-to-play-game

https://www.bbd.casino/info_details/how-to-win-online-casino

https://www.bbd.casino/info_details/best-way-to-play-roulette-online

https://www.bbd.casino/info_details/guaranteed-win-online-casino

https://www.bbd.casino/info_details/how-to-win-918kiss-jackpot

https://www.bbd.casino/info_details/best-game-to-play-at-casino

https://www.bbd.casino/info_details/tricks-to-winning-on-slot-machines

https://www.bbd.casino/info_details/malaysia-online-casino-promotion

https://www.bbd.casino/info_details/slot-game-malaysia

https://www.bbd.casino/info_details/online-slots-malaysia

https://www.bbd.casino/info_details/online-betting-malaysia

https://www.bbd.casino/info_details/trusted-online-casino-malaysia

https://www.bbd.casino/info_details/online-gambling-in-malaysia

https://www.bbd.casino/info_details/genting-casino

https://www.bbd.casino/info_details/online-casino-malaysia

https://www.bbd.casino/info_details/best-slot-machines-to-play-2021

https://www.bbd.casino/info_details/best-casino-games-for-beginners

https://www.bbd.casino/info_details/how-are-slot-machines-made

https://www.bbd.casino/info_details/how-do-slot-machine-work

https://www.bbd.casino/info_details/how-to-play-slot-machine-for-beginners

https://www.bbd.casino/info_details/how-to-play-slot-machine

https://www.bbd.casino/info_details/how-to-tell-if-a-slot-machine-is-rea...

https://www.bbd.casino/info_details/how-to-win-at-roulette

https://www.bbd.casino/info_details/how-to-win-online-casino-games

https://www.bbd.casino/info_details/mobile-slot-malaysia

https://www.bbd.casino/info_details/online-gambling-real-money

https://www.bbd.casino/info_details/real-casino-online-malaysia

https://www.bbd.casino/info_details/slot-machine-payout-schedule

https://www.bbd.casino/info_details/how-to-win-roulette-in-real-casino

https://www.bbd.casino/info_details/how-to-win-slot

https://www.bbd.casino/info_details/mobile-casino-pay-with-phone-credit

https://www.bbd.casino/info_details/online-casino-top-up-by-mobile

https://www.bbd.casino/info_details/tricks-to-winning-on-slot-machines-a...

https://www.bbd.casino/info_details/which-slot-machines-pay-the-best-2021

https://www.bbd.casino/info_details/best-online-betting-sites-malaysia

https://www.bbd.casino/info_details/how-to-read-betting-odds

https://www.bbd.casino/info_details/understanding-betting-lines

https://www.bbd.casino/info_details/how-to-read-horse-racing-program

https://www.bbd.casino/info_details/how-to-read-a-horce-racing-form

https://www.bbd.casino/info_details/how-to-be-good-at-poker

https://www.bbd.casino/info_details/how-to-play-fish-table-online

https://www.bbd.casino/info_details/how-to-play-idn-poker-malaysia

Appreciate this post. Will

Appreciate this post. Will try it out.|

Does your site have a contact

Does your site have a contact page? I'm having a tough time locating it but, I'd
like to shoot you an email. I've got some creative ideas for your blog you might be interested in hearing.

Either way, great blog and I look forward to seeing it develop
over time.

I enjoy what you guys tend to

I enjoy what you guys tend to be up too. This type of clever work
and reporting! Keep up the amazing works guys I've added you guys to blogroll.

I am regular reader, how are

I am regular reader, how are you everybody?
This article posted at this website is actually good.

My relatives every time say

My relatives every time say that I am wasting my time here at web, however
I know I am getting knowledge daily by reading
thes good posts.

I have read so many posts on

I have read so many posts on the topic of the blogger lovers but this post is really a fastidious paragraph, keep it up.|

I love reading through an

I love reading through an article that will make people think. Also, thank you for allowing me to comment!|

I've been exploring for a bit

I've been exploring for a bit for any high quality articles or blog posts in this kind of space . Exploring in Yahoo I ultimately stumbled upon this web site. Reading this information So i am glad to show that I have a very good uncanny feeling I discovered just what I needed. I most unquestionably will make certain to don?t omit this website and give it a glance regularly.|

always i used to read smaller

always i used to read smaller content that also clear their motive, and that is also happening with this piece of writing which I am reading at this place.

Write more, thats all I have

Write more, thats all I have to say. Literally, it seems as though you relied on the
video to make your point. You definitely know what youre talking about, why throw away your intelligence
on just posting videos to your weblog when you could be giving
us something informative to read?

Why visitors still use to

Why visitors still use to read news papers when in this technological globe all is accessible on net?|

What a information of

What a information of un-ambiguity and preserveness of
valuable know-how regarding unpredicted feelings.

Hmm it seems like your

Hmm it seems like your website ate my first comment (it was super
long) so I guess I'll just sum it up what I submitted and say, I'm thoroughly enjoying your blog.
I too am an aspiring blog writer but I'm still new to everything.
Do you have any suggestions for novice blog writers? I'd really appreciate it.

I'm very pleased to discover

I'm very pleased to discover this page. I wanted to thank you for your time due to this fantastic read!!
I definitely enjoyed every little bit of it and I have you saved to fav to check out new stuff in your
site.

This piece of writing

This piece of writing provides clear idea in support of the new users of blogging, that in fact how to do blogging.|

Woah! I'm really digging the

Woah! I'm really digging the template/theme of
this website. It's simple, yet effective. A lot of times it's hard to get that "perfect balance" between user friendliness
and visual appearance. I must say you have done a great
job with this. Additionally, the blog loads super
quick for me on Internet explorer. Outstanding Blog!

Hi there friends, how is all,

Hi there friends, how is all, and what you desire to say regarding this paragraph, in my view its truly awesome designed for me.|

I don't even understand how I

I don't even understand how I ended up right here, but I believed this post was good.

I don't know who you might be however certainly you're going to a well-known blogger in case you are not already.

Cheers!

I think everything posted

I think everything posted made a ton of sense. But, what about this? suppose you composed a catchier post title? I am not saying your content is not solid, but what if you added something that grabbed people's attention? I mean %BLOG_TITLE% is a little vanilla. You could look at Yahoo's front page and note how they create article headlines to grab people interested. You might try adding a video or a pic or two to grab people excited about everything've written. In my opinion, it would bring your posts a little bit more interesting.|

Heya i am for the first time

Heya i am for the first time here. I came across this board and I find It really useful & it helped me out much. I hope to give something back and aid others like you aided me.|

Howdy very nice blog!! Man ..

Howdy very nice blog!! Man .. Beautiful .. Amazing .. I'll bookmark your web site and take the feeds additionally? I'm satisfied to find a lot of useful info right here within the submit, we want work out more strategies on this regard, thank you for sharing. . . . . .|

Great goods from you, man. I

Great goods from you, man. I have understand your stuff previous to and you are just extremely excellent.
I actually like what you have acquired here, really like what
you're saying and the way in which you say it. You
make it entertaining and you still take care of to keep
it smart. I cant wait to read far more from
you. This is actually a great site.

Yes! Finally someone writes

Yes! Finally someone writes about click here.

Hello, this weekend is

Hello, this weekend is pleasant designed for me, because this moment i am reading this enormous educational article here at
my home.

Undeniably believe that which

Undeniably believe that which you stated. Your favorite reason appeared to be on the internet the easiest thing to be aware of. I say to you, I definitely get annoyed while people think about worries that they plainly don't know about. You managed to hit the nail upon the top and defined out the whole thing without having side-effects , people could take a signal. Will likely be back to get more. Thanks|

Appreciate this post. Will

Appreciate this post. Will try it out.

Hi, I desire to subscribe for

Hi, I desire to subscribe for this blog to take newest updates, so where can i
do it please help out.

My brother suggested I might

My brother suggested I might like this web site. He was totally right.

This post truly made my day. You cann't imagine
just how much time I had spent for this information! Thanks!

Hey would you mind stating

Hey would you mind stating which blog platform you're using?
I'm going to start my own blog in the near future but I'm having a tough time choosing between BlogEngine/Wordpress/B2evolution and
Drupal. The reason I ask is because your
layout seems different then most blogs and I'm looking for something unique.
P.S Sorry for being off-topic but I had to ask!

Great weblog right here!

Great weblog right here! Additionally your web site a lot up fast! What host are you the usage of? Can I get your affiliate hyperlink on your host? I wish my web site loaded up as quickly as yours lol|

Hi there! I know this is

Hi there! I know this is somewhat off topic but I was wondering if you knew where I could get a captcha plugin for my comment form?
I'm using the same blog platform as yours and I'm having problems finding
one? Thanks a lot!

always i used to read smaller

always i used to read smaller articles or reviews that as well clear their motive, and that is also happening with
this post which I am reading now.

I would like to thank you for

I would like to thank you for the efforts you've put in writing this blog. I am hoping to see the same high-grade blog posts from you later on as well. In truth, your creative writing abilities has inspired me to get my own, personal site now ;)|

Helpful information.

Helpful information. Fortunate me I discovered your site accidentally,
and I'm shocked why this coincidence did not happened earlier!
I bookmarked it.

Normally I do not read post

Normally I do not read post on blogs, but I wish to say that
this write-up very compelled me to take a look at and do it!

Your writing style has been surprised me. Thanks, very great post.

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.