You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/01/13 13:16:38 UTC

[GitHub] [incubator-nuttx] fjpanag opened a new pull request #5217: syslog: Fix in file channel initialization.

fjpanag opened a new pull request #5217:
URL: https://github.com/apache/incubator-nuttx/pull/5217


   ## Summary
   
   When creating a new syslog file channel through `syslog_file_channel()`, any previous file channel was automatically destroyed and substituted by the new channel.
   
   This creates a couple of issues:
   * You couldn't have more than one file channels. I really don't see the reason for this limitation.
   * If the channel was already destroyed by any other means (e.g. by a call to `syslog_channel_remove()`), `syslog_file_channel()` would try to re-destroy an already non-existent channel. This will lead to a system crash.
   
   The later is very important, as with this limitation files cannot residue on removable storages (not efficiently at least).  
   You cannot create and destroy the channel as the medium is inserted/removed.
   
   This PR intends to fix this.  
   Channels are only created with `syslog_file_channel()` and only destroyed with `syslog_channel_remove()`.
   
   
   ## Impact
   
   Applications that were relying on `syslog_file_channel()` to clean-up any previous channels will now have to be changed to use 
   `syslog_channel_remove()` before the creation of the new channel.
   
   However this is not an expected use-case. There is no need to re-initialize a file channel ever.  
   
   If indeed the file residues on an external medium, the application must not call `syslog_file_channel()` again, as syslog_device already contains logic to re-open files in case of failure (i.e. the medium was removed).
   
   
   ## Testing
   
   Basic build test only, for an STM32F427 target.  
   I will un-draft it when testing is complete, I hope later today.
   


-- 
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: commits-unsubscribe@nuttx.apache.org

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



[GitHub] [incubator-nuttx] fjpanag commented on pull request #5217: syslog: Fix in file channel initialization.

Posted by GitBox <gi...@apache.org>.
fjpanag commented on pull request #5217:
URL: https://github.com/apache/incubator-nuttx/pull/5217#issuecomment-1012382935


   Tested on actual hardware, custom board based on an STM32F427 MCU.  
   The log file is located in an SD card, and the log channel is added / removed as the card is mounted / unmounted.
   
   Everything is performing as expected.


-- 
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: commits-unsubscribe@nuttx.apache.org

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



[GitHub] [incubator-nuttx] pkarashchenko merged pull request #5217: syslog: Fix in file channel initialization.

Posted by GitBox <gi...@apache.org>.
pkarashchenko merged pull request #5217:
URL: https://github.com/apache/incubator-nuttx/pull/5217


   


-- 
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: commits-unsubscribe@nuttx.apache.org

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