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

Appreciate this post. Will

Appreciate this post. Will try it out.

Keep on working, great job!

Keep on working, great job!

It's going to be ending of

It's going to be ending of mine day, except before finish I am reading this impressive paragraph to improve my know-how.

I love it when people come

I love it when people come together and share ideas. Great
blog, stick with it!
Jim's San Jose Carpet Cleaning
780 S 3rd St, San Jose, CA 95112
3408-351-1063
colettemackie2641 [at] gmail [dot] com

Hi there all, here every one

Hi there all, here every one is sharing these kinds of know-how,
therefore it's good to read this website, and I used to go
to see this webpage everyday.

Hi my loved one! I wish to

Hi my loved one! I wish to say that this article is amazing, great written and
include almost all vital infos. I'd like to peer extra posts like this .

It is not my first time to go

It is not my first time to go to see this site, i am visiting this site
dailly and take pleasant data from here everyday.

I always emailed this web

I always emailed this web site post page to all my friends, as if like to read it
then my contacts will too.

I really love your site..

I really love your site.. Very nice colors & theme.

Did you create this web site yourself? Please reply back as I'm
hoping to create my own personal site and want to
find out where you got this from or exactly what the theme is named.

Cheers!

Simply want to say your

Simply want to say your article is as surprising.
The clarity in your post is simply nice and i could assume you're an expert on this subject.
Fine with your permission allow me to grab your feed to keep up to
date with forthcoming post. Thanks a million and please carry on the gratifying work.

Hello to all, because I am

Hello to all, because I am truly eager of reading this webpage's post to be updated
on a regular basis. It includes nice stuff.

Thank you for another

Thank you for another excellent article. The
place else may anybody get that type of information in such an ideal means of writing?
I have a presentation next week, and I am on the look for such info.

Hi there, constantly i used

Hi there, constantly i used to check webpage posts here early in the break of day, since i enjoy to gain knowledge of more and more.

If some one needs expert view

If some one needs expert view regarding blogging afterward
i recommend him/her to pay a visit this webpage, Keep
up the good work.

It's going to be end of mine

It's going to be end of mine day, however before
finish I am reading this wonderful piece of writing to improve
my experience.

I am genuinely grateful to

I am genuinely grateful to the holder of this site who has shared
this impressive article at at this place.

It is the best time to make

It is the best time to make some plans for the future and it's
time to be happy. I have read this post and if I
could I wish to suggest you few interesting things or suggestions.
Perhaps you could write next articles referring to this article.
I wish to read more things about it!

It is not my first time to go

It is not my first time to go to see this website, i am browsing this web page dailly and take nice data from here all the time.

I couldn't refrain from

I couldn't refrain from commenting. Perfectly written!

I'd like to find out more?

I'd like to find out more? I'd like to find out some additional information.

I'm really impressed with

I'm really impressed with your writing skills as well as with the layout on your weblog.
Is this a paid theme or did you customize it yourself?
Either way keep up the nice quality writing, it's rare to see a great blog
like this one today.

It's an awesome article

It's an awesome article designed for all the online users; they will take advantage from it I am sure.

No matter if some one

No matter if some one searches for his essential thing,
thus he/she wants to be available that in detail, thus that thing is maintained over here.

I know this site provides

I know this site provides quality depending articles and
extra material, is there any other website which offers these kinds of information in quality?

Do you have any video of

Do you have any video of that? I'd want to find
out some additional information.
Jim's San Jose Carpet Cleaning
780 S 3rd St, San Jose, CA 95112
3408-351-1063
colettemackie2641 [at] gmail [dot] com

I'm really enjoying the

I'm really enjoying the design and layout of your website.
It's a very easy on the eyes which makes it much more pleasant for me
to come here and visit more often. Did you hire out a designer to create your theme?
Exceptional work!

When I initially commented I

When I initially commented I clicked the "Notify me when new comments are added" checkbox
and now each time a comment is added I get four e-mails with the same comment.
Is there any way you can remove people from that service?

Thanks a lot!

Very nice post. I definitely

Very nice post. I definitely love this website. Thanks!

Because the admin of this web

Because the admin of this web page is working, no hesitation very soon it will be renowned,
due to its feature contents.

Thank you for sharing your

Thank you for sharing your info. I really appreciate your efforts and I am waiting
for your next write ups thanks once again.

If you desire to obtain a

If you desire to obtain a good deal from this article then you have to apply these methods to your won weblog.

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

What's up, for all time i

What's up, for all time i used to check website posts here in the early hours in the daylight, because i like to
find out more and more.

Wonderful blog! I found it

Wonderful blog! I found it while surfing around on Yahoo News.
Do you have any tips on how to get listed in Yahoo
News? I've been trying for a while but I never seem to get there!
Thank you
Jay's Santa Clarita Tree Removal Kings
26174 Las Lanas Ct, Santa Clarita, CA 91355
661-464-1270
laureljefferson09875 [at] gmail [dot] com

Hello! This post could not be

Hello! This post could not be written any
better! Reading through this post reminds me of my previous room mate!
He always kept chatting about this. I will forward this page
to him. Fairly certain he will have a good read.
Thank you for sharing!

Pretty nice post. I just

Pretty nice post. I just stumbled upon your weblog and wished to say that I've truly
enjoyed browsing your blog posts. After all I'll be subscribing to your
feed and I hope you write again very soon!

Woah! I'm really enjoying the

Woah! I'm really enjoying the template/theme of this blog.
It's simple, yet effective. A lot of times it's very
difficult to get that "perfect balance" between usability and visual appearance.
I must say you've done a superb job with this. In addition, the blog loads extremely fast for me on Firefox.
Excellent Blog!
OutOfSight Hayward Junk Removal Pros
1366 Homestead Ln, Hayward, CA 94545
510-621-6379
joeyedmonds38572 [at] gmail [dot] com

Hey! I know this is somewhat

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

Hi, everything is going

Hi, everything is going perfectly here and ofcourse every one is sharing information, that's genuinely fine, keep up writing.

Hello great blog! Does

Hello great blog! Does running a blog such as this
take a large amount of work? I've absolutely no knowledge of computer programming but I had been hoping to start my
own blog soon. Anyways, if you have any suggestions or techniques for new blog owners please share.
I know this is off subject however I simply wanted to ask.
Thanks a lot!

Anaheim Divorce Lawyers in Practice
204 S Illinois St, Anaheim, CA 92805
714-410-5333
sabihafelix09835 [at] gmail [dot] com

I was recommended this

I was recommended this website through my cousin. I'm no longer certain whether this submit is written by him as nobody else realize such exact about my difficulty.
You're wonderful! Thank you!

This design is steller! You

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

I was recommended this web

I was recommended this web site by my cousin. I'm
not sure whether this post is written by him as no one else know such detailed about my trouble.

You're wonderful! Thanks!
Jay's Santa Clarita Tree Removal Kings
26174 Las Lanas Ct, Santa Clarita, CA 91355
661-464-1270
laureljefferson09875 [at] gmail [dot] com

Pretty element of content. I

Pretty element of content. I simply stumbled
upon your blog and in accession capital to assert that I get in fact enjoyed account your
weblog posts. Any way I'll be subscribing on your augment and even I
achievement you get entry to persistently quickly.

There's definately a great

There's definately a great deal to know about this topic. I love
all the points you have made.
Jim's San Jose Carpet Cleaning
780 S 3rd St, San Jose, CA 95112
3408-351-1063
colettemackie2641 [at] gmail [dot] com

Good day! Do you use Twitter?

Good day! Do you use Twitter? I'd like to follow you if that would be ok.
I'm definitely enjoying your blog and look forward to new updates.

I am sure this post has

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

Hi there just wanted to give

Hi there just wanted to give you a quick heads up.
The text in your content seem to be running off the screen in Firefox.

I'm not sure if this is a formatting issue or something to do with internet browser compatibility
but I figured I'd post to let you know. The style and design look great though!
Hope you get the issue solved soon. Cheers

Awesome! Its actually awesome

Awesome! Its actually awesome post, I have
got much clear idea about from this paragraph.

Wow, fantastic weblog format!

Wow, fantastic weblog format! How lengthy have you been running a blog
for? you made running a blog glance easy. The overall
glance of your web site is great, let alone the content material!

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

Do you mind if I quote a

Do you mind if I quote a couple of your articles as long as I provide credit and sources back
to your site? My website is in the exact same area of interest as yours and my users would genuinely benefit from some
of the information you provide here. Please let me know if this okay with you.

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.