Skip to content

Commit

Permalink
Merge pull request #2898 from atlanhq/enable-maintenance
Browse files Browse the repository at this point in the history
feat: block tag propagation if maintenance mode is turned on
  • Loading branch information
sumandas0 authored Mar 28, 2024
2 parents 2741cea + 0ff6bc5 commit ded0e0b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ public void shutdown() {

@Override
public void run() {
boolean isMaintenanceMode = AtlasConfiguration.ATLAS_MAINTENANCE_MODE.getBoolean();
if (isMaintenanceMode) {
LOG.info("TaskQueueWatcher: Maintenance mode is enabled, new tasks will not be loaded into the queue until next restart");
return;
}
shouldRun.set(true);

if (LOG.isDebugEnabled()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ public void doFilter(ServletRequest servletRequest, ServletResponse servletRespo
// Block all the POST, PUT, DELETE operations
HttpServletRequest request = (HttpServletRequest) servletRequest;
HttpServletResponse response = (HttpServletResponse) servletResponse;
if (isBlockedMethod(request.getMethod()) && !request.getRequestURI().contains("indexsearch")) {
if (isBlockedMethod(request.getMethod()) && !request.getRequestURI().contains("search") &&
!request.getRequestURI().contains("lineage")) {
LOG.error("Maintenance mode enabled. Blocking request: {}", request.getRequestURI());
sendMaintenanceModeResponse(response);
return; // Stop further processing
Expand Down

0 comments on commit ded0e0b

Please sign in to comment.