You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by "fschulze-dtm (via GitHub)" <gi...@apache.org> on 2024/09/12 12:35:07 UTC

[I] [Bug] Docker signal handling not working [iotdb]

fschulze-dtm opened a new issue, #13498:
URL: https://github.com/apache/iotdb/issues/13498

   ### Search before asking
   
   - [X] I searched in the [issues](https://github.com/apache/iotdb/issues) and found nothing similar.
   
   
   ### Version
   
   iotdb 1.3.1-standalone
   
   ### Describe the bug and provide the minimal reproduce step
   
   When stoping a docker container running the apache/iotdb:1.3.1-standalone image the SIGTERM signal handling trap is not executed leading to a non graceful shut down. This is because the entrypoint.sh script uses `exec` which destroys signal handlers using `trap.`
   
   Furthermore, the function that should be executed at SIGTERM 'on_stop' defined in entrypoint.sh has the if statement `"$start_what"` != "all".` Therfore in standalone mode the corresponding graceful shutdown is not executed.
   
   To reproduce run the docker container and then stop it. 
   
   ### What did you expect to see?
   
   The on_stop function defined in entrypoint.sh is executed when the docker container is stopped providing a graceful shutdown with FLUSH.
   
   ### What did you see instead?
   
   Rapid shut down without proper SIGNAL handling and withour execution of the on_stop function.
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [ ] I'm willing to submit a PR!


-- 
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: reviews-unsubscribe@iotdb.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] Docker signal handling not working [iotdb]

Posted by "CritasWang (via GitHub)" <gi...@apache.org>.
CritasWang commented on issue #13498:
URL: https://github.com/apache/iotdb/issues/13498#issuecomment-2360578221

   Is there no problem with the logic here
   
   ```
   if [[ "$start_what" != "confignode" ]]; then
           echo "###### manually flush ######";
           start-cli.sh -e "flush;" || true
           stop-datanode.sh
           echo "##### done ######";
       else
           stop-confignode.sh;
       fi
   ```


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] Docker signal handling not working [iotdb]

Posted by "CritasWang (via GitHub)" <gi...@apache.org>.
CritasWang commented on issue #13498:
URL: https://github.com/apache/iotdb/issues/13498#issuecomment-2406435127

   > > Is there no problem with the logic here
   > > ```
   > > if [[ "$start_what" != "confignode" ]]; then
   > >         echo "###### manually flush ######";
   > >         start-cli.sh -e "flush;" || true
   > >         stop-datanode.sh
   > >         echo "##### done ######";
   > >     else
   > >         stop-confignode.sh;
   > >     fi
   > > ```
   > 
   > This is the code snippet from apache/iotdb:1.3.2-standalone image. In apache/iotdb:1.3.1-standalone it is
   > 
   > ```
   > if [[ "$start_what" == "datanode" ]]; then
   >     echo "###### manually flush ######";
   >     start-cli.sh -e "flush;" || true
   >     echo "stopping datanode service";
   >     stop-datanode.sh ;
   >     echo "##### done ######";
   > elif [[ "$start_what" != "all" ]]; then
   >     echo "###### manually flush ######";
   >     start-cli.sh -e "flush;" || true
   >     echo "stopping confignode and datanode service";
   >     stop-standalone.sh ;
   >     echo "##### done ######";
   > elif [[ "$start_what" == "confignode" ]]; then
   >     echo "stopping confignode service";
   >     stop-confignode.sh;
   >     echo "##### done ######";
   > fi
   > ```
   > 
   > Also the main problem of using `exec` in the entrypoint.sh which kills the `trap` remains.
   
   Actually, an elegant shutdown only requires calling the stop script.
   ```
   start-cli.sh -e "flush;"
   ```
   
   This operation is just a guarantee mechanism, and after calling the stop script, the program will also perform corresponding elegant shutdown processing internally


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] Docker signal handling not working [iotdb]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #13498:
URL: https://github.com/apache/iotdb/issues/13498#issuecomment-2346165427

   Hi, this is your first issue in IoTDB project. Thanks for your report. Welcome to join the community!


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org