[ 
https://issues.apache.org/jira/browse/TS-4085?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15065268#comment-15065268
 ] 

James Fang commented on TS-4085:
--------------------------------

 Sorry i didn't make it clear.

By "global lua global", i really mean a global environment shared among all the 
lua_newstate that ts_lua created.

What i want to do is to intercept some request that modifying this "global lua 
global", so that i can update my
acl rules from ATS itself without some outside mechanisms as well as avoid 
reloading ATS.
I don't know if this is the right approach to accomplish this, and i am also 
concerning the impact of reloading ATS
on a production server.

>From my understanding, ts_lua creates TS_LUA_MAX_STATE_COUNT lua_newstate when 
>started, and each
request is running from its own lua_newthread from one of these lua_newstate. 
Each lua_newthread gets its global
environment from its parent lua_newstate, but this enviornment is somewhat 
modified so it can only read but
not write to its parent's environment.
So the problem is:
1) a ts_lua request's ts_newthread can't modify the global environment of its 
parent's lua_newstate;
2) even 1) is doable, the other (TS_LUA_MAX_STATE_COUNT - 1) lua_newstate are 
not changed

Anyway, reloading ts_lua when running as a global plugin is also a great 
feature to have.



> Supporting reloading lua script on ats reload for ts_lua when run as a global 
> plugin
> ------------------------------------------------------------------------------------
>
>                 Key: TS-4085
>                 URL: https://issues.apache.org/jira/browse/TS-4085
>             Project: Traffic Server
>          Issue Type: New Feature
>          Components: Lua, Plugins
>            Reporter: James Fang
>            Assignee: Kit Chan
>             Fix For: sometime
>
>
> suppose i have some acl rules that seldom changes,
> i would like to make them a global table that shared among all the lua 
> coroutines.
> i also would like to update the rule without restarting traffic server, but
> there seems to be no way to update this global after they are initalized.
> should i modify ts_lua to call some dynamic uploaded chunk that
> update the global for each ts_lua_main_ctx ?
> any ideas ?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to