Skip to content

this prevents some missing symbols because of a dependency cycle#18

Open
frett wants to merge 1 commit intomogilefs:masterfrom
frett:cycleBug
Open

this prevents some missing symbols because of a dependency cycle#18
frett wants to merge 1 commit intomogilefs:masterfrom
frett:cycleBug

Conversation

@frett
Copy link
Copy Markdown

@frett frett commented Jun 8, 2012

this is a minor module dependency fix.

there is a dependency cycle in the form of:

MogileFS::Server -> MogileFS::ReplicationPolicy::MultipleHosts -> MogileFS::ReplicationRequest -> MogileFS::Server

this doesn't cause problems when MogileFS::Server is loaded first, but when MogileFS::ReplicationRequest is loaded first, MogileFS::ReplicationPolicy::MultipleHosts breaks with the following error:

Bareword "ALL_GOOD" not allowed while "strict subs" in use at /usr/local/share/perl5/MogileFS/ReplicationPolicy/MultipleHosts.pm line 47.
Bareword "TOO_GOOD" not allowed while "strict subs" in use at /usr/local/share/perl5/MogileFS/ReplicationPolicy/MultipleHosts.pm line 65.
Bareword "TOO_GOOD" not allowed while "strict subs" in use at /usr/local/share/perl5/MogileFS/ReplicationPolicy/MultipleHosts.pm line 66.
Bareword "ALL_GOOD" not allowed while "strict subs" in use at /usr/local/share/perl5/MogileFS/ReplicationPolicy/MultipleHosts.pm line 67.
Bareword "ALL_GOOD" not allowed while "strict subs" in use at /usr/local/share/perl5/MogileFS/ReplicationPolicy/MultipleHosts.pm line 68.
Bareword "ALL_GOOD" not allowed while "strict subs" in use at /usr/local/share/perl5/MogileFS/ReplicationPolicy/MultipleHosts.pm line 76.
Bareword "TEMP_NO_ANSWER" not allowed while "strict subs" in use at /usr/local/share/perl5/MogileFS/ReplicationPolicy/MultipleHosts.pm line 93.
Bareword "TEMP_NO_ANSWER" not allowed while "strict subs" in use at /usr/local/share/perl5/MogileFS/ReplicationPolicy/MultipleHosts.pm line 98.
Compilation failed in require at /usr/local/share/perl5/MogileFS/Server.pm line 63.
BEGIN failed--compilation aborted at /usr/local/share/perl5/MogileFS/Server.pm line 63.
Compilation failed in require at /usr/local/share/perl5/MogileFS/ReplicationRequest.pm line 3.
BEGIN failed--compilation aborted at /usr/local/share/perl5/MogileFS/ReplicationRequest.pm line 3.

an easy command to see this breakage is:
perl -mMogileFS::ReplicationRequest -e'1;'

I ran into this bug when upgrading the MogileFS database, my first plugin utilized MogileFS::FID, which requires MogileFS::ReplicationRequest before MogileFS::Server has been loaded.

@dormando
Copy link
Copy Markdown
Member

I've fixed a few of these... it's worth staring at more, so I need to punt for this cycle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants