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

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|

I got this website from my

I got this website from my pal who informed me regarding this web page
and now this time I am visiting this web site and reading very informative articles or reviews
at this time.

This is my first time visit

This is my first time visit at here and i am in fact happy to read all at one place.

This post offers clear idea

This post offers clear idea in support of the new users of blogging,
that genuinely how to do blogging.

If you are going for most

If you are going for most excellent contents like I do,
simply go to see this web page all the time for the reason that it
presents quality contents, thanks

Woah! I'm really loving the

Woah! I'm really loving the template/theme of this blog.
It's simple, yet effective. A lot of times it's hard to get that "perfect balance"
between superb usability and visual appearance. I must say you have done a very good job with this.

Also, the blog loads super quick for me on Internet explorer.
Superb Blog!

It's wonderful that you are

It's wonderful that you are getting ideas from this paragraph as well
as from our argument made at this place.

I know this if off topic but

I know this if off topic but I'm looking into starting my own blog and was curious what all is required to get set up?
I'm assuming having a blog like yours would cost a pretty penny?
I'm not very internet smart so I'm not 100% sure.
Any tips or advice would be greatly appreciated.
Many thanks

I used to be suggested this

I used to be suggested this web site via my cousin. I am not positive whether or not this post is written by way of him as
no one else know such specified approximately my difficulty.
You are wonderful! Thanks!

Hello! I know this is kind of

Hello! I know this is kind of off topic but I was wondering which blog platform are you using for this site?
I'm getting fed up of Wordpress because I've had issues with hackers and I'm
looking at alternatives for another platform. I would be awesome if you could point me in the direction of a
good platform.

My programmer is trying to

My programmer is trying to persuade me to move to .net from PHP.
I have always disliked the idea because of the expenses.
But he's tryiong none the less. I've been using Movable-type on numerous websites for about a year and am nervous about
switching to another platform. I have heard very good
things about blogengine.net. Is there a way I can import all my
wordpress posts into it? Any kind of help would be really appreciated!

Hey! Would you mind if I

Hey! Would you mind if I share your blog with my myspace
group? There's a lot of people that I think would really appreciate
your content. Please let me know. Cheers

hi!,I like your writing very

hi!,I like your writing very a lot! proportion we keep
in touch more about your article on AOL? I need an expert in this house to solve my problem.
May be that is you! Looking ahead to peer you.

Hi there would you mind

Hi there would you mind letting me know which hosting company you're using?
I've loaded your blog in 3 completely different internet
browsers and I must say this blog loads a lot faster then most.

Can you recommend a good internet hosting provider
at a honest price? Thank you, I appreciate it!

Good blog you've got here..

Good blog you've got here.. It's difficult to find good quality writing like yours nowadays.
I truly appreciate people like you! Take care!!

Wow, wonderful blog

Wow, wonderful blog structure! How lengthy have you ever been blogging for?

you make running a blog look easy. The full glance of your website
is excellent, let alone the content!

Howdy, i read your blog from

Howdy, i read your blog from time to time and i own a similar one and i was
just wondering if you get a lot of spam remarks? If so how
do you prevent it, any plugin or anything you can advise?
I get so much lately it's driving me mad so any support is very much
appreciated.

Good day! Do you know if they

Good day! Do you know if they make any plugins
to protect against hackers? I'm kinda paranoid about losing everything I've worked hard on. Any tips?

Good day! I know this is

Good day! I know this is kinda 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 difficulty finding one? Thanks a lot!

Aw, this was an exceptionally

Aw, this was an exceptionally nice post. Taking a few minutes and actual effort to create a
great article… but what can I say… I procrastinate a lot
and never seem to get anything done.

Aw, this was an extremely

Aw, this was an extremely nice post. Taking the time and actual effort to create a really
good article… but what can I say… I put things off a lot
and never manage to get nearly anything done.

This is really interesting,

This is really interesting, You are a very skilled blogger.
I've joined your feed and look forward to seeking more of your
wonderful post. Also, I've shared your web site in my social networks!

WOW just what I was looking

WOW just what I was looking for. Came here by searching for best mattress

Attractive portion of

Attractive portion of content. I just stumbled upon your site and
in accession capital to say that I get in fact enjoyed account your blog posts.
Anyway I'll be subscribing in your feeds and even I success you get
right of entry to persistently rapidly.

Thank you, I've just been

Thank you, I've just been looking for info about this subject for a long time
and yours is the best I've found out till now.
However, what in regards to the bottom line? Are you
sure in regards to the supply?

An interesting discussion is

An interesting discussion is definitely worth comment. I think that you should publish more about this topic,
it might not be a taboo matter but generally
people do not discuss these subjects. To the next!
Kind regards!!

This design is steller! You

This design is steller! You most 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!

This website was... how do

This website was... how do you say it? Relevant!!
Finally I've found something that helped me.
Kudos!

If some one wants to be

If some one wants to be updated with most recent technologies therefore
he must be go to see this site and be up to date everyday.

Thanks , I have recently been

Thanks , I have recently been searching for information approximately this subject for a while and yours is
the greatest I have found out till now. But, what in regards to
the bottom line? Are you certain concerning the supply?

Pretty nice post. I just

Pretty nice post. I just stumbled upon your weblog and
wanted to say that I've truly enjoyed surfing around your blog posts.

After all I'll be subscribing to your rss feed and I hope you
write again very soon!

magnificent points

magnificent points altogether, you simply gained a
logo new reader. What might you recommend in regards to your publish
that you just made some days ago? Any certain?

Hey there! I've been reading

Hey there! I've been reading your site for some time now
and finally got the bravery to go ahead and give you a shout
out from Houston Tx! Just wanted to say keep up the excellent job!

I am not sure where you're

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

Thank you for the auspicious

Thank you for the auspicious writeup. It in fact was a amusement account it.
Look advanced to far added agreeable from you!
However, how can we communicate?

Hey there would you mind

Hey there would you mind letting me know which web host you're using?
I've loaded your blog in 3 completely different browsers and I must say this blog loads a lot quicker
then most. Can you suggest a good hosting provider at a reasonable price?
Cheers, I appreciate it!

My brother suggested I may

My brother suggested I may like this blog.
He was entirely right. This publish actually made
my day. You can not believe just how so much time I had spent for
this information! Thank you!

It's going to be finish of

It's going to be finish of mine day, except before finish I am reading this great
paragraph to improve my experience.

Yes! Finally someone writes

Yes! Finally someone writes about click here.

An interesting discussion is

An interesting discussion is worth comment. I do believe that you ought to write
more on this topic, it may not be a taboo subject but typically people don't discuss these topics.
To the next! All the best!!

I will right away clutch your

I will right away clutch your rss as I can't find your email subscription hyperlink or e-newsletter
service. Do you have any? Please permit me realize so that I could subscribe.
Thanks.

Definitely believe that which

Definitely believe that which you stated. Your favourite reason appeared to be on the
net the easiest thing to understand of. I say to you, I definitely get irked even as folks think about issues that
they plainly do not recognize about. You managed
to hit the nail upon the top and also defined out the entire thing with no need side effect , other folks
can take a signal. Will probably be again to get more.
Thanks

Fantastic web site. Lots of

Fantastic web site. Lots of helpful info here. I am sending it to some pals ans additionally sharing in delicious.
And certainly, thanks in your effort!

You've made some good points

You've made some good points there. I looked on the net to learn more about the issue and found most people will go along with your views on this website.

Fine way of explaining, and

Fine way of explaining, and fastidious post to get facts regarding my presentation focus,
which i am going to deliver in school.

Yes! Finally someone writes

Yes! Finally someone writes about click here.

Hello There. I found your

Hello There. I found your weblog the use
of msn. This is a really well written article.
I will be sure to bookmark it and return to learn extra of your helpful information. Thanks
for the post. I will definitely return.

Remarkable! Its really

Remarkable! Its really amazing paragraph, I have
got much clear idea concerning from this paragraph.

Howdy, i read your blog

Howdy, i read your blog occasionally and i own a similar one and i was just wondering if you get a lot of
spam responses? If so how do you prevent it, any plugin or
anything you can suggest? I get so much lately it's driving me crazy so any support is very much appreciated.

I read this paragraph fully

I read this paragraph fully regarding the difference of newest and previous technologies, it's remarkable article.

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.