Forum Discussion
zhanghr_101384
Nimbostratus
Oct 22, 2009Global variables shared across virtual servers and irle scripts?
It seems that all global variables defined in RULE_INIT event are shared across different irule scripts, even if they are deployed on different virtual servers.
I have created one irule script for my local box testing, where some global variable are defined inside RULE_INIT. Then to test it in our DEV environment, I copied and renamed the same script, and set different values for all global variables for the DEV environment. Now, both scripts are imported into a same Big-Ip server, but deployed to different virtual servers there. What I found out is that the global variables will always have the same values, depending on which script is loaded last. Certainly this is not the behavior I want!
Can someone confirm this is expected behavior of irule and Big-Ip and I am not missing anything obvious?
If global variables are truly shared this way, is it a little too dangerous, as two irule script authors from two divisions of a company may name some global variables samely, causing a conflict without knowing it? To me, shouldn't the boundary of global variables be set up at least between virtual servers?
Besides making global variable names fully qualified, can someone recommend any other ways to avoid such conflicts?
Thanks a lot in advance!
- hoolio
Cirrostratus
This is expected. From a past post: - zhanghr_101384
Nimbostratus
Thanks a lot for the answer!
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects