potiuk opened a new pull request, #46993:
URL: https://github.com/apache/airflow/pull/46993

   We used to send SIGQUIT to running containers in tests if they were running 
for too long - that was supposed to handled the case when a test was hanging in 
the way that pytest timeout handling could not break individual tests. That 
signal was set about 10 minutes before the total job timeout to give the tests 
time to upload log files and print diagnostics information before the runner 
was killed by Github Actions mechanisms.
   
   This however was not enough - we had recently a number of hanging tests that 
were failing after 1h 58 minutes - which means that our signal sending to 
docker containers were not effective - and our SIGQUIT was not effective.
   
   This PR makes the timeout code more resilient and possibly gives us a chance 
to see what is going on:
   
   1) we are printing more diagnostics information when we attempt to
      send the signals
   2) we are sending SIGTERM instead of SIGQUIT as this seems to be
      more standard way of stopping containers (SIGQUIT was default
      STOPSIGNAL in the past but SIGTERM is now more commonly used)
   3) we wait 10 seconds after sending the signal and if the containers
      are still running we send SIGKILL to the containers which - in
      theory kill the containers always, unconditionally - and give
      us a chance to print and upload diagnostics information.
   
   <!--
    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you under the Apache License, Version 2.0 (the
    "License"); you may not use this file except in compliance
    with the License.  You may obtain a copy of the License at
   
      http://www.apache.org/licenses/LICENSE-2.0
   
    Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an
    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, either express or implied.  See the License for the
    specific language governing permissions and limitations
    under the License.
    -->
   
   <!--
   Thank you for contributing! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   Feel free to ping committers for the review!
   
   In case of an existing issue, reference it using one of the following:
   
   closes: #ISSUE
   related: #ISSUE
   
   How to write a good git commit message:
   http://chris.beams.io/posts/git-commit/
   -->
   
   
   
   <!-- Please keep an empty line above the dashes. -->
   ---
   **^ Add meaningful description above**
   Read the **[Pull Request 
Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines)**
 for more information.
   In case of fundamental code changes, an Airflow Improvement Proposal 
([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals))
 is needed.
   In case of a new dependency, check compliance with the [ASF 3rd Party 
License Policy](https://www.apache.org/legal/resolved.html#category-x).
   In case of backwards incompatible changes please leave a note in a 
newsfragment file, named `{pr_number}.significant.rst` or 
`{issue_number}.significant.rst`, in 
[newsfragments](https://github.com/apache/airflow/tree/main/newsfragments).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to