* fix(NotificationCenter): use RWLock to prevent lock-order-inversion #5150
Change NotificationCenter from Mutex to RWLock to fix TSAN lock-order-inversion
warnings when notification handlers call back into the notification center
(e.g., hasEventHandler() from within a SocketReactor handler).
Key changes:
- Replace Mutex with RWLock for better read concurrency
- Use read locks for hasObserver(), observersToNotify(), hasObservers(),
countObservers(), backlog()
- Use write locks for addObserver(), removeObserver(), clear()
- observersToNotify() now copies observer list and releases lock before
calling accepts() to avoid lock cycle with NObserver's internal mutex
- Add clear() method to atomically disable and remove all observers
- Update AsyncNotificationCenter to use RWLock::ScopedLock
Also fixes AsyncNotificationCenter shutdown to properly signal the dequeue
thread via ShutdownNotification instead of relying only on wakeUpAll() #5058
* fix(Net): add SocketReactor::remove() for safe socket cleanup #5150
Add SocketReactor::remove() method that atomically removes a socket
from the poll set and disables all its event handlers. This prevents
race conditions when removing handlers in destructors, where events
could still be dispatched to handlers while other handlers for the
same socket are being removed.
Changes:
- Add SocketReactor::remove(socket) for atomic socket removal
- Add SocketNotifier::disableObservers() to disable all handlers
- Add SocketNotifier::socket() getter
- Skip dispatch for removed sockets in dispatch() methods
- Update tests to use remove() before removeEventHandler()
- Add testSocketReactorRemove() test
* fix(Foundation): improve ProcessRunner robustness #5054
- Fix race condition: set _pPH after _pid to ensure pid() returns
valid value when running() returns true
- Add upfront invalid PID validation before termination attempt
- Escalate to Process::kill() if requestTermination times out,
with its own timeout before throwing
- Try to remove stale PID file on timeout instead of throwing
- Wrap start() wait logic in try/catch to kill orphan process
and reset state if startup fails
- Clear _error under lock after successful stop to prevent
stale error from affecting next start()
* Update Net/include/Poco/Net/SocketReactor.h
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update Foundation/src/AsyncNotificationCenter.cpp
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update Foundation/include/Poco/AsyncNotificationCenter.h
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update Foundation/src/AsyncNotificationCenter.cpp
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* chore: add TaskManager::testCancel to win ignore list
* chore: few improvements in NotificationCenter and ODBC cmake.
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Matej Kenda <matejken@gmail.com>
* Util::Application: unified argument handling to reduce code duplication
* Syntax fix for Util::Application on Win32
* Util::Application: fix for _WIN32
* Explicitly delete and default constructors of Subsystem.
* Data::TypeHandler: suppress MSVC warning about implicitly deleted destructor
* Poco::Util: deleted/defaulted constructors, override annotations
* Application, ServerApplication: some cleanup
* Default member initializers for Util::Option
* Poco::Util: more deleted/defaulted constructors, override annotations
* Overload of AbstractConfiguration::keys() that returns the result
* Util::LocalConfigurationView as a variant of ConfigurationView
* Util::SystemConfiguration: use map of functions
* Util: update copyright notices
* Util::AbstractConfigurationView
* Poco::Util::Units::abs template
* Overloads for Application::getApplicationPath and getApplicationDirectory
* Potential fix for code scanning alert no. 1696: No raw arrays in interfaces
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
* Potential fix for code scanning alert no. 1697: Commented-out code
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
* Documentation fix for AbstractConfiguration
* More fixes for code scanning alert no. 1696: No raw arrays in interfaces
---------
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
* fix(Data): Refactor ODBC tests and fix testReconnect TypeInfo caching #5136
- Add TypeInfo::reset() to clear cached type info, called on session close
to fix testReconnect failing when connection is reestablished
- Move common test methods from ODBC SQLExecutor to shared DataTest
SQLExecutor for better code reuse across database backends
- Improve error message in hasTransactionIsolation() to be more descriptive
- Refactor ODBC MySQL and PostgreSQL test executors to delegate to
shared base implementation
- Update MySQL, PostgreSQL, and SQLite test suites to use refactored
executor methods
- Add Nix shell environments for MySQL and PostgreSQL test databases
with auto-start/stop and ODBC driver configuration
* chore: pass executor name
* chore: nix-shell documentation
* chore: nix-shell documentation
* feat: add optional/tuple tests to ODBC Oracle and SQLServer #5136
* fix(ODBC): add missing functions implementations #5136
* TypeHandler for std::tuple, used to implement TypeHandler for Poco::Tuple
* Removed obsolete using declarations in Data.cppm
* TypeHander: added missing typename
* Explicitly delete constructors of AbstractTypeHandler
* TypeHandler specialization for std::optional
* Data/MySQL: modernize loops and usage of virtual/override
* Poco::Tuple: formatting fix
* Poco::Data: more consistent usage of virtual/override and = delete
* Added test cases for std::tuple and std::optional (for MySQL and PostgreSQL)
* Poco::Data: more override annotations
* Added testcases for st::tuple and std::optional to SQLite.
* chore(Data): Improvements suggested by clang-tidy
---------
Co-authored-by: Matej Kenda <matejken@gmail.com>
* fix(SharedLibrary): Missing DLLs not reported #5069
* fix(CMake): not producing proper binary names #5070
* fix(SharedLibrary): disable shared lib tests in static build #5069
* fix(misc): add pdjson links to gitignore, remove unused var in SharedLibrary, harden TaskManagerTest
* fic(ci): separate oracle and sqlserver odbc (out of disk space) (#5075)
* fic(ci): separate oracle and sqlserver odbc (out of disk space)
* use oracle odbc driver
* use oracle free
* ad db user
* postpone adding user after build
* remove default tablespace (does not exist)
* reinstate all ci jobs
* add postgresl odb tests to ci
* remove spurious syminks
* fix gitignore (pdjson)
* Remove VS projects #5076
* chore: revert leftover ODB IP address
* fix(CodeQL): float comparison alerts
* fix: compile errors
* chore: upgrade asan to macos-14 (tryout)
* fix: .gitignore symlinks; XML Makefile wrong pattern
* Optimize PatternFormatter and Timezone performance #5078
PatternFormatter:
- Cache node name (Environment::nodeName()) to avoid repeated syscalls
- Add extractBasename() for efficient %O format specifier
- Add string reserve(128) to reduce reallocations during formatting
Timezone:
- Cache UTC offset to avoid repeated syscalls (8x speedup for %L patterns)
- Auto-detect TZ environment variable changes to invalidate cache
- Add reloadCache() method for explicit cache refresh
Tests:
- Add TimezoneTest::testUtcOffsetCaching()
- Add PatternFormatterTest::testExtractBasename()
* fix: use Path::separatorin extractBasename #5078
* Add Benchmark #5080
* enh(Logging): move constructors for Message and Logger #5078
* chore(AsyncNotificationCenter): eliminate MSVC warnings
* enh(build): c++20 support #5084
* feat(CppUnit): print class name
execute all named tests (not only the first one)
accept test name with class (eg. testrunner LoggerTest::testLogger) #5083
* feat(Benchmark): Add Logger/FastLogger comparison benchmarks and Windows support
- Add LoggerBench.cpp with AsyncChannel vs FastLogger benchmarks
- Add compare.sh (Linux/macOS) and compare.ps1 (Windows) scripts
- Add LOGGER_BENCHMARK.md with cross-platform benchmark results
- Update README.md with Windows build instructions (Ninja, CMAKE_PREFIX_PATH)
- Add error message when -- options are used on Windows (should use /)
- Update CMakeLists.txt and Makefile to include LoggerBench #5080
* feat(FastLogger): #5078
FastLogger provides a Poco-compatible wrapper around the Quill logging
library, offering significant performance improvements over AsyncChannel
through lock-free SPSC queues and backend thread processing.
Key features:
- Drop-in replacement for Poco::Logger with FastLogger::get()
- Support for all standard Poco channels (Console, File, Rotating, etc.)
- XML/properties configuration via FastLoggerConfigurator
- Thread affinity for backend worker on Linux and Windows
- Log file rotation with size and time-based policies
Performance (CPU time - calling thread latency):
- Linux: 31-70x faster than AsyncChannel
- Windows: 23-87x faster than AsyncChannel
- macOS: Limited improvement due to lack of thread affinity support
New files:
- Foundation/include/Poco/FastLogger.h
- Foundation/src/FastLogger.cpp
- Util/include/Poco/Util/FastLoggerConfigurator.h
- Util/src/FastLoggerConfigurator.cpp
- dependencies/quill/ (header-only Quill 7.5.0 library)
* fix(cmake): disable FastLogger on emscripten (not supported) #5078
* feat(FastLogger): add cpuAfinity config parameter #5087
* fix(FastLogger): Fix lock-order-inversion in FastLogger (TSAN) #5078
* fix(cmake): build not stripping release binaries #5085
* fix(PCRE): fails to compile with clang/c++20 #5131
* feat(AsyncChannel): add CPU affinity property #5087
* feat(SpinlockMutex): make it adaptive #5132
* feat(AsyncChannel): add CPU affinity property #5087
* chore: remove leftover file commited by mistake
* feat(build): allow FastLogger to be fully disabled at build time #5078
Build system changes:
- Add POCO_NO_FASTLOGGER compile definition in CMake when ENABLE_FASTLOGGER=OFF
to prevent Config.h from auto-enabling FastLogger
- Add ifdef guards around FastLogger tests in LoggingTestSuite.cpp
- Exclude FastLoggerTest.cpp and FastLoggerChannelsTest.cpp from CMake build
when FastLogger is disabled
- Add POCO_NO_FASTLOGGER support to Make build system for Foundation and Util
- Add CI jobs to verify builds work without FastLogger (CMake and Make)
Code changes:
- Add LoggingConfigurator::configure() convenience method for quick logging setup
* fix(ci): testrunner args
* chore(progen): remove leftover script #5076
* fix(test): give ANC a bit more time to process
* fix(ci): set env before test run
* chore(doc): quill license
* feat(Channel): add log(Message&&) #5133
* fix(ci): set env before test run
* fix(TestRunner): don't search children #5083
* feat: lock-free queues #5134
* feat(Benchmark): various comparisons
* chore: cleanup benchmark
* fix(SharedLibrary): Missing DLLs not reported #5069
* fix(CMake): not producing proper binary names #5070
* fix(SharedLibrary): disable shared lib tests in static build #5069
* fix(misc): add pdjson links to gitignore, remove unused var in SharedLibrary, harden TaskManagerTest
* fic(ci): separate oracle and sqlserver odbc (out of disk space) (#5075)
* fic(ci): separate oracle and sqlserver odbc (out of disk space)
* use oracle odbc driver
* use oracle free
* ad db user
* postpone adding user after build
* remove default tablespace (does not exist)
* reinstate all ci jobs
* add postgresl odb tests to ci
* remove spurious syminks
* fix gitignore (pdjson)
* Remove VS projects #5076
* chore: revert leftover ODB IP address
* fix(CodeQL): float comparison alerts
* fix: compile errors
* chore: upgrade asan to macos-14 (tryout)
* fix(CI): Github macos-13 runner is deprecated, use macos-15-intel to run tests on Intel macOS
---------
Co-authored-by: Matej Kenda <matejken@gmail.com>
* feat(AsyncNotificationCenter): Auto-configure number of workers #5060
add/removeObserver utility functions
move AsyncNotificationCenter tests into a separate file
tests
* chore: update copyrighht
* Add support for modules
* Use "" for inclusion
* Fix missing includes on Poco.Data module
* Add PDF and SevenZip modules, and match modules to build macros
* Add CI test
* Add missing link libraries in CMake
* Add remaining libraries DNSSD, CppParser and CppUnit. Changed some static declarations to inline to export
* We also need to forward the ENABLE_NETSSL_* macros
* Update CMakeLists files
* Add samples as requested, with DateTime and URI test for example
* Fix POCO_MODULES_INSTALL macro
* chore(CMake): Combine install macro for libraries and C++ modules into one macro.
* Apply testsuite changes and address include directories concerns
* Restore accidentally deleted build files
* Mistakenly added a file generated by CMake, removed.
---------
Co-authored-by: Matej Kenda <matejken@gmail.com>
* chore(PCRE): properly detect library type on newer macOS
* chore(ZLIB): move source files to own zlib directory and update CMake files.
* chore(PCRE): move source files to own pcre2 directory and update CMake files.
* chore(UTF8PROC): move source files to own utf8proc directory and update CMake files.
* chore(ZLIB): remove header files
* chore(PDJSON): move source files to own pdjson directory and update CMake files.
* chore(SQLite3): move source files to own sqlite3 directory and update CMake files.
* chore(UNBUNDLED): Correct includes.
* chore(expat): move source files to own expat directory and update CMake files.
* chore(wepoll): move source files to own wepoll directory and update CMake files.
* chore(7zip): move source files to own 7zip directory and update CMake files.
* chore(CMake): fix compile and link flags for dependent static libraries
* chore(CMake): set PCRE2_STATIC when building PCRE2.
* chore(SQLite3): Set SQLITE_THREADSAFE for unbundled build, add warnings.
* chore(CMake): Modifications to build and link properly static target libraries (using OBJECT library type and link using BUILD_LOCAL_INTERFACE)
* chore(CMake): fix order of includes in main CMakeLists.txt.
* chore(CI): Build mysql tests with cmake.
* chore(CI): Build mongodb, redis, sqlite no parser tests with cmake.
* chore(CI): Build odbc tests with cmake.
* chore(CI): Build more ations with cmake, other fixes.
* chore(CI): Fixes for macOS
* chore(CMake): extract hpdf and png files to own directories in dependencies
* fix(CMake): include dependencies after all module dependencies are resolved.
* fix(CMake): Improve dependency handling of dependencies to compile them only when necessary.
* fix(CMake): PDF: move t4.h to proper directory, modify include.
* fix(CMake): Fixes to link properly on all platforms.
* fix(CMAKE): Wrong ENABLE for SQLITE
* enh(PDF): Remove dependencies on hpdf headers from Poco::PDF interface and make usage of hpdf only internal.
* enh(CI): Convert more jobs to use cmake.
* enh(CI): Convert macOS sanitizer jobs to use cmake.
* enh(mkrelease): Copy dependencies when creating release package.
* eng(CMake): Add missing POCO_SO option to enable/disable small object optimization.
* enh(CI): Run linux sanitizer with cmake, various fixes and improvements.
* fix(CMake): bundled build: ZLIB::ZLIB is already linked with Foundation, no need to link again to Poco::Zip
* fix(CI): vptr undefined sanitizer causes foundation tests to fail when linking, disable it
* chore(tests): Minor code improvements.
* fix(AsyncNotificationCenter): fix a data race with member _listsEmpty by making it atomic.
* eng(CI): Add a few more time sensitive tests to cppignore.lnx
* chore(Thread): Code updates.
* eng(CI): Add a few more time sensitive tests to cppignore.lnx
* fix(AsyncNotificationCenter): must join threads to avoid data race in dtor.
* chore(CI): Pass TSAN_OPTIONS to jobs where necessary
* chore(CI): run rests without sudo, compile with parallelism
* chore(CI): Use POCO_MINIMAL_BUILD to simplify CMake configure lines.
* chore(CI): Add 32-bit Windows VS build
* chore(CMake): Printout cmake generator platform.
* chore(CMake): linux-gcc-make-armv7l -> linux-gcc-cmake-armv7l
* chore(ci): windows-2025-msvc-cmake-32bit -> windows-2025-msvc-cmake-Win32
* chore(CI): Convert all remaining jobs to CMake.
* chore(make): Prevent building with make.
* chore(CodeQL): exclude all external code from CodeQL checks.
* chore(macOS): Set min support version to 13.3 to properly support C++20 standard.
* New SQLite Only Unbundled Option
A new option to use an unbundled (external) SQLite but all other dependencies internal.
* Match Other Option Styles
Force the POCO_SQLITE_UNBUNDLED option to ON when POCO_UNBUNDLED is on. Switching to this style to match the rest of the Poco cmake options.
* sample(DBLogger): New sample to demonstrate DB logging to a file. (#4750)
* sample(DBLogger): Create messages via SQL logger in a thread (#4750)
* sample(DBLogger): Save messages from SQL files to an SQL database (works with SQLite) (#4750)
* chore(Makefile): Data samples depend on PocoUtil (#4750)
* sample(DBLogger): Refactored DBLogger with std::filesystem::directory_iterator and std::thread.
* sample(DBLogger): Add missing include <condition_variable>
* sample(DBLogger): Extracted log scanning and inserting functionality to class SQLLogInserter.
* sample(DBLogger): Create new logging table only when using demo messages option.
* feat(DBLogger): VS projects
* sample(DBLogger): Acquire options from configuration file.
* feat(DBLogger): regenerate VS projects (progen file change)
* sample(DBLogger): Add example DBLogger.properties file.
* sample(DBLogger): Process as much as possible when stopping processing.
* sample(DBLogger): Meaningful defaults in properties file.
* sample(DBLogger): Verify validity of database session on startup.
* sample(DBLogger): Configure demo SQL channel in properties file.
* chore(DBLogger): style and warnings
---------
Co-authored-by: Aleksandar Fabijanic <aleks-f@users.noreply.github.com>
Co-authored-by: Alex Fabijanic <alex@pocoproject.org>
* feat(PocoDoc): search support
* feat(PocoDoc): enable FTS5 for search support
* feat(PocoDoc): enable FTS5
* chore(pocodoc): edit comment
* fix(StreamCopier): add argument to seekg
* enable searchIndex through the command line
* Add minor updates for search support
* Update of vs90 and regeneration of vs160 and vs170 projects
* Enhance configure script:FTS5 support for SQLite in --sqlite-fts flag
* Add tests for FTS3 and FTS5
* regeneration of vs160 and vs170 projects
* added missing lib data in CMake
* Update vs90 project and regenerate vs160 and vs170 projects with added Data include paths
* Revrting ProGen_vs170.vcxproj
* Revert ProGen in vs170 and regenerate PocoDoc vs160/vs170 projects to include updated Data path
* added missing includes
---------
Co-authored-by: Lara <lara@debian-gnu-linux-12.localdomain>
* fix(Data::ODBC): use connection and login timeouts in ODBC session implementation (#4366)
* fix(Data::ODBC): use only connection timeout in ODBC session implementation (#4366)
* fix(ODBC): consolidate login timeout; create temp directory if it doesn't exist #4366
---------
Co-authored-by: Alex Fabijanic <alex@pocoproject.org>