Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

frett
Copy link

@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
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
2 participants