You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@chukwa.apache.org by "Saisai Shao (JIRA)" <ji...@apache.org> on 2012/08/03 07:35:02 UTC
[jira] [Updated] (CHUKWA-654) HICC session hosts bug
[ https://issues.apache.org/jira/browse/CHUKWA-654?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Saisai Shao updated CHUKWA-654:
-------------------------------
Description:
when using Host Selector widget to select one host, like "localhost", in workspace.js code save_host() function
for(var i=0;i< obj.options.length;i++) {
if(obj.options[i].selected) {
if(i!=0) {
cookie = cookie + "," + obj.options[i].value;
} else {
cookie = obj.options[i].value;
}
}
}
var myAjax=new Ajax.Request(
"/hicc/jsp/session.jsp",
{
asynchronous: false,
method: 'post',
parameters: "hosts="+cookie
}
);
this code will rise a ajax request to set hosts in session, but the hosts variable in session will be set like ",localhost", a additional comma will be added even there is only one host selected. I think this bug is introduced by above code.
And this will cause MetricsController.java getSeriesBySessionAttribute() function
String[] rkeys = (session.getAttribute(skey).toString()).split(",");
to split this hosts variable to a zero length string, like string "" and string "localhost", using this string "" to get data in HBase will retrieve no data.
was:
when using Host Selector widget to select one host, like "localhost", in workspace.js code save_host() function
for(var i=0;i< obj.options.length;i++) {
if(obj.options[i].selected) {
if(i!=0) {
cookie = cookie + "," + obj.options[i].value;
} else {
cookie = obj.options[i].value;
}
}
}
var myAjax=new Ajax.Request(
"/hicc/jsp/session.jsp",
{
asynchronous: false,
method: 'post',
parameters: "hosts="+cookie
}
);
this code will rise a ajax request to set hosts in session, but the hosts variable in session will be set like ",localhost", a additional comma will be added even there is only one host selected. I think this bug is introduced by above code.
And this will cause MetricsController.java getSeriesBySessionAttribute()
String[] rkeys = (session.getAttribute(skey).toString()).split(",");
to split this hosts variable to a zero length string, like string "" and string "localhost", using this string "" to get data in HBase will retrieve no data.
> HICC session hosts bug
> ----------------------
>
> Key: CHUKWA-654
> URL: https://issues.apache.org/jira/browse/CHUKWA-654
> Project: Chukwa
> Issue Type: Bug
> Components: User Interface
> Affects Versions: 0.6.0
> Environment: RHEL5 Hadoop 1.0.3 Hbase0.94.0
> Reporter: Saisai Shao
> Fix For: 0.6.0
>
>
> when using Host Selector widget to select one host, like "localhost", in workspace.js code save_host() function
> for(var i=0;i< obj.options.length;i++) {
> if(obj.options[i].selected) {
> if(i!=0) {
> cookie = cookie + "," + obj.options[i].value;
> } else {
> cookie = obj.options[i].value;
> }
> }
> }
> var myAjax=new Ajax.Request(
> "/hicc/jsp/session.jsp",
> {
> asynchronous: false,
> method: 'post',
> parameters: "hosts="+cookie
> }
> );
> this code will rise a ajax request to set hosts in session, but the hosts variable in session will be set like ",localhost", a additional comma will be added even there is only one host selected. I think this bug is introduced by above code.
> And this will cause MetricsController.java getSeriesBySessionAttribute() function
> String[] rkeys = (session.getAttribute(skey).toString()).split(",");
> to split this hosts variable to a zero length string, like string "" and string "localhost", using this string "" to get data in HBase will retrieve no data.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira