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

Have you ever considered

Have you ever considered about including a little bit more than just
your articles? I mean, what you say is important and everything.
Nevertheless think about if you added some great pictures or video clips
to give your posts more, "pop"! Your content is excellent but with images and clips,
this website could certainly be one of the most beneficial in its niche.

Great blog!

Thanks for your personal

Thanks for your personal marvelous posting! I quite enjoyed
reading it, you may be a great author. I will ensure that I bookmark
your blog and will eventually come back sometime soon. I want to encourage that you continue your great posts,
have a nice morning!

I really love your site..

I really love your site.. Pleasant colors & theme.
Did you create this website yourself? Please reply back
as I'm wanting to create my own blog and would like to learn where you got this from or what the theme
is named. Thanks!

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 info. Thanks for the post.
I will definitely return.

Excellent goods from you,

Excellent goods from you, man. I have understand
your stuff previous to and you are just extremely fantastic.
I actually like what you have got here, certainly
like what you are stating and the way in which you say it.
You are making it entertaining and you still care for to stay it smart.
I can not wait to learn far more from you. This is really a wonderful web site.

I am in fact thankful to the

I am in fact thankful to the holder of this web site who has shared this great post at at this place.

Heya this is kind of of off

Heya this is kind of of off topic but I was wondering if
blogs use WYSIWYG editors or if you have to manually code with HTML.
I'm starting a blog soon but have no coding know-how so I
wanted to get advice from someone with experience. Any help would
be enormously appreciated!

Nice answers in return of

Nice answers in return of this question with solid arguments and explaining the whole thing
about that.

I think everything published

I think everything published was actually very logical.

But, what about this? suppose you typed a catchier title?
I ain't suggesting your content isn't good, but what
if you added something that makes people desire more? I
mean Válasz a hozzászólásra is kinda vanilla.
You ought to glance at Yahoo's home page and note how they create news titles
to grab viewers to open the links. You might add a related video or a related
pic or two to grab people interested about what you've written.
Just my opinion, it might bring your posts a little livelier.

Excellent items from you,

Excellent items from you, man. I have understand
your stuff previous to and you're simply too excellent. I actually like what you
have obtained right here, certainly like what you're saying and the best way during
which you assert it. You're making it enjoyable and you continue to care for to stay it wise.
I can not wait to learn far more from you. That
is actually a tremendous site.

Excellent post. I am facing

Excellent post. I am facing some of these issues
as well..

Appreciation to my father who

Appreciation to my father who told me regarding this blog,
this web site is in fact amazing.

hello!,I like your writing

hello!,I like your writing very much! share we be in contact more approximately
your post on AOL? I need an expert in this house to solve my problem.
Maybe that is you! Having a look forward to peer you.

Just want to say your article

Just want to say your article is as surprising. The
clearness in your post is simply cool and i can assume
you're an expert on this subject. Fine with your permission allow me to grab your RSS feed to keep up to date with forthcoming post.
Thanks a million and please continue the gratifying work.

I don't even know how I ended

I don't even know how I ended up here, but I thought this post was great.
I don't know who you are but definitely you're going to a famous
blogger if you aren't already ;) Cheers!

This is a topic that is close

This is a topic that is close to my heart... Cheers! Exactly where are
your contact details though?

Asking questions are in fact

Asking questions are in fact fastidious thing if you are not understanding anything completely, but this paragraph presents nice understanding even.
Jim's San Jose Carpet Cleaning
780 S 3rd St, San Jose, CA 95112
3408-351-1063
colettemackie2641 [at] gmail [dot] com

Really no matter if someone

Really no matter if someone doesn't be aware of after that its up to other
users that they will assist, so here it happens.

Right away I am going to do

Right away I am going to do my breakfast, once having my breakfast
coming over again to read additional news.

I got this web page from my

I got this web page from my buddy who told me on the topic of this
website and at the moment this time I am visiting this website
and reading very informative content here.

Hi there, just became aware

Hi there, just became aware of your blog through Google, and found that it is
truly informative. I'm gonna watch out for brussels.
I will appreciate if you continue this in future. A lot of people will be benefited from your writing.

Cheers!

Hi I am so excited I found

Hi I am so excited I found your site, I really found you by mistake, while I was researching
on Yahoo for something else, Regardless I am here now and would just like
to say many thanks for a incredible post and a all round
thrilling blog (I also love the theme/design),
I don’t have time to read it all at the moment but I have saved it and also included your RSS
feeds, so when I have time I will be back to read more, Please do keep
up the fantastic b.

I loved as much as you will

I loved as much as you will receive carried out right here.
The sketch is attractive, your authored material stylish.
nonetheless, you command get got an shakiness over that
you wish be delivering the following. unwell
unquestionably come further formerly again since exactly the same nearly a lot often inside case you shield this increase.

It's remarkable in favor of

It's remarkable in favor of me to have a site, which is helpful designed
for my knowledge. thanks admin

I blog quite often and I

I blog quite often and I really thank you for your information. The article has really peaked my
interest. I'm going to bookmark your site and keep checking for new details about once a week.

I subscribed to your Feed as well.

This is really interesting,

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

Appreciate this post. Will

Appreciate this post. Will try it out.

Amazing things here. I am

Amazing things here. I am very satisfied to peer your article.

Thanks a lot and I am looking ahead to contact you. Will
you please drop me a mail?

Appreciation to my father who

Appreciation to my father who stated to me concerning
this weblog, this weblog is truly awesome.

Hi there are using Wordpress

Hi there are using Wordpress for your site platform?

I'm new to the blog world but I'm trying to get started and set up my own. Do you require any coding knowledge to make your own blog?
Any help would be really appreciated!

Hello I am so excited I found

Hello I am so excited I found your weblog, I really found you by error, while I was researching
on Bing for something else, Anyhow I am here now and would just like to say
thank you for a marvelous post and a all round thrilling blog (I also love the theme/design), I
don't have time to go through it all at the moment 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.

I like the valuable info you

I like the valuable info you provide in your articles.
I will bookmark your blog and check again here frequently.
I'm quite certain I will learn many new stuff right here!
Best of luck for the next!

Hey there! I'm at work

Hey there! I'm at work browsing your blog from my new iphone 3gs!
Just wanted to say I love reading through your blog and look forward to all your
posts! Keep up the fantastic work!
Jay's Santa Clarita Tree Removal Kings
26174 Las Lanas Ct, Santa Clarita, CA 91355
661-464-1270
laureljefferson09875 [at] gmail [dot] com

Wow! This blog looks exactly

Wow! This blog looks exactly like my old one! It's on a completely different topic but it has
pretty much the same page layout and design. Excellent choice of colors!

Very energetic blog, I liked

Very energetic blog, I liked that a lot. Will there be a part 2?

Thanks for finally talking

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

Everyone loves it when folks

Everyone loves it when folks come together and share views.
Great website, continue the good work!
Jim's San Jose Carpet Cleaning
780 S 3rd St, San Jose, CA 95112
3408-351-1063
colettemackie2641 [at] gmail [dot] com

Howdy! I simply want to offer

Howdy! I simply want to offer you a big thumbs up for the
excellent info you have right here on this post. I'll be coming back to your web site
for more soon.

Hello to every body, it's my

Hello to every body, it's my first visit of this webpage; this blog consists of awesome
and truly fine material for readers.

It's the best time to make

It's the best time to make some plans for the future and it's time to be happy.

I've read this post and if I could I desire to suggest you some interesting things or tips.
Maybe you can write next articles referring to this article.
I wish to read even more things about it!
Jay's Santa Clarita Tree Removal Kings
26174 Las Lanas Ct, Santa Clarita, CA 91355
661-464-1270
laureljefferson09875 [at] gmail [dot] com

Hey there! I know this is

Hey there! I know this is kinda off topic nevertheless
I'd figured I'd ask. Would you be interested in trading links or maybe guest authoring a blog article or
vice-versa? My website goes over a lot of the same subjects as yours and I feel
we could greatly benefit from each other. If you might be interested feel free
to shoot me an email. I look forward to hearing from you!
Great blog by the way!

Wonderful post! We are

Wonderful post! We are linking to this great post on our website.
Keep up the great writing.

It's amazing in support of me

It's amazing in support of me to have a web page, which is good
in support of my experience. thanks admin

Thanks for your marvelous

Thanks for your marvelous posting! I actually enjoyed reading it, you can be a great author.I will be
sure to bookmark your blog and will eventually come back
in the foreseeable future. I want to encourage you continue your great job,
have a nice weekend!

I was suggested this web site

I was suggested this web site by means of my cousin.
I'm not certain whether or not this post is written via him as nobody else realize such specified about my problem.
You're amazing! Thanks!

I used to be recommended this

I used to be recommended this website by means of my cousin. I'm no longer certain whether this put up is written through him as no one else recognize such precise approximately my difficulty. You're incredible! Thanks!|

Hi, I desire to subscribe for

Hi, I desire to subscribe for this website to take latest updates, thus where can i do it
please help.

I blog frequently and I

I blog frequently and I really appreciate your content.

Your article has truly peaked my interest.
I'm going to bookmark your website and keep checking for new
information about once per week. I opted in for your Feed too.

Hi to all, it's really a

Hi to all, it's really a fastidious for me to pay a
quick visit this website, it includes important Information.
Jim's San Jose Carpet Cleaning
780 S 3rd St, San Jose, CA 95112
3408-351-1063
colettemackie2641 [at] gmail [dot] com

I was very happy to uncover

I was very happy to uncover this website. I wanted
to thank you for ones time due to this wonderful
read!! I definitely liked every bit of it and I have you book-marked to see new
stuff on your blog.

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.