bool should_log = false;
RGWREST* rest = penv.rest;
RGWRESTMgr *mgr;
+ bool is_health_request = false;
RGWHandler_REST *handler = rest->get_handler(driver, s,
*penv.auth_registry,
frontend_prefix,
abort_early(s, NULL, -ERR_METHOD_NOT_ALLOWED, handler, yield);
goto done;
}
+ is_health_request = (op->get_type() == RGW_OP_GET_HEALTH_CHECK);
{
s->trace_enabled = tracing::rgw::tracer.is_enabled();
- std::string script;
- auto rc = rgw::lua::read_script(s, penv.lua.manager.get(), s->bucket_tenant, s->yield, rgw::lua::context::preRequest, script);
- if (rc == -ENOENT) {
- // no script, nothing to do
- } else if (rc < 0) {
- ldpp_dout(op, 5) << "WARNING: failed to read pre request script. error: " << rc << dendl;
- } else {
- rc = rgw::lua::request::execute(driver, rest, penv.olog.get(), s, op, script);
- if (rc < 0) {
- ldpp_dout(op, 5) << "WARNING: failed to execute pre request script. error: " << rc << dendl;
+ if (!is_health_request) {
+ std::string script;
+ auto rc = rgw::lua::read_script(s, penv.lua.manager.get(),
+ s->bucket_tenant, s->yield,
+ rgw::lua::context::preRequest, script);
+ if (rc == -ENOENT) {
+ // no script, nothing to do
+ } else if (rc < 0) {
+ ldpp_dout(op, 5) <<
+ "WARNING: failed to execute pre request script. "
+ "error: " << rc << dendl;
+ } else {
+ rc = rgw::lua::request::execute(driver, rest, penv.olog.get(), s, op, script);
+ if (rc < 0) {
+ ldpp_dout(op, 5) <<
+ "WARNING: failed to execute pre request script. "
+ "error: " << rc << dendl;
+ }
}
}
}
s->trace->SetAttribute(tracing::rgw::OBJECT_NAME, s->object->get_name());
}
}
- std::string script;
- auto rc = rgw::lua::read_script(s, penv.lua.manager.get(), s->bucket_tenant, s->yield, rgw::lua::context::postRequest, script);
- if (rc == -ENOENT) {
- // no script, nothing to do
- } else if (rc < 0) {
- ldpp_dout(op, 5) << "WARNING: failed to read post request script. error: " << rc << dendl;
- } else {
- rc = rgw::lua::request::execute(driver, rest, penv.olog.get(), s, op, script);
- if (rc < 0) {
- ldpp_dout(op, 5) << "WARNING: failed to execute post request script. error: " << rc << dendl;
+ if (!is_health_request) {
+ std::string script;
+ auto rc = rgw::lua::read_script(s, penv.lua.manager.get(),
+ s->bucket_tenant, s->yield,
+ rgw::lua::context::postRequest, script);
+ if (rc == -ENOENT) {
+ // no script, nothing to do
+ } else if (rc < 0) {
+ ldpp_dout(op, 5) <<
+ "WARNING: failed to read post request script. "
+ "error: " << rc << dendl;
+ } else {
+ rc = rgw::lua::request::execute(driver, rest, penv.olog.get(), s, op, script);
+ if (rc < 0) {
+ ldpp_dout(op, 5) <<
+ "WARNING: failed to execute post request script. "
+ "error: " << rc << dendl;
+ }
}
}
}