The behavior of Couchbase Lite C when attempting to connect to a Sync Gateway

Overview

This demo demonstrates the behavior of Couchbase Lite C when attempting to connect to a Sync Gateway, while the process has various numbers of file descriptors open. Once a process uses more than 1024 file descriptors, behavior of Couchbase Lite C changes.

Linux

Setup

In the /linux directory, do the following:

  1. Unpack the Couchbase Lite package for the host platform into the vendor directory.
  2. Run mkdir build && cd build && cmake .. && cmake --build .
  3. Make sure no Sync Gateway is running at localhost:5000.
  4. Run ./build/main <fd-count> where fdCount is the number of file descriptors to open before attempting to replicate with a Sync Gateway.

Observed behavior on Ubuntu 20.04:

When running the demo with a low number (~100) of file descriptors, the demo will just fail to connect to the sync gateway with POSIX error 111, "Connection refused".

When running the demo with a high number (1000+) of file descriptors, the demo will fail to connect with the wrong error: POSIX error 110, "Connection timed out".

Android

In the /android directory, do the following:

  1. Unpack the Couchbase Lite package for android into the vendor directory. The expected name of the package directory is libcblite-3.0.0.
  2. Open the project with Android Studio.
  3. Run the App until it crashes with the following abort message:
    Abort message: 'FORTIFY: FD_SET: file descriptor 1076 >= FD_SETSIZE 1024'
    
  4. Run adb logcat -d > logcat.txt to get the logcat output.
  5. Use nkd-stack to symbolicate the stack trace:
    ndk-stack -sym vendor/libcblite-3.0.0/lib/$ANDROID_ABI$/ -i logcat.txt
    

/data contains an example logcat.txt file and the corresponding stack-trace.txt.

Relevant Files

  • CmakeLists.txt: to build native-lib library and package CBL C with the app.
  • app/src/main/cpp/native-lib.cc: Native shared library which calls CBL C.
  • app/src/main/java/com/example/cbl_c_fd_max_demo/NativeLib.java: Java code which calls native-lib
  • app/src/main/java/com/example/cbl_c_fd_max_demo/MainActivity.kt: runDemo method launches demo code.
You might also like...
Loco-strings-sync - A custom Gradle Plugin useful to sync loco string resources to local projects

loco-strings-sync A custom Gradle Plugin useful to sync loco string resources to

Connect is an Android Application to connect people for a project and can then work on the application to efficiently complete the project
Connect is an Android Application to connect people for a project and can then work on the application to efficiently complete the project

Connect is an Android Application to connect people for a project and can then work on the application to efficiently complete the project

*** WARNING: This library is no longer maintained *** An easy way to add a simple 'swipe-and-do-something' behavior to your `RecyclerView` items. Just like in Gmail or Inbox apps.
*** WARNING: This library is no longer maintained *** An easy way to add a simple 'swipe-and-do-something' behavior to your `RecyclerView` items. Just like in Gmail or Inbox apps.

SwipeToAction An easy way to add a simple 'swipe-and-do-something' behavior to your RecyclerView items. Just like in Gmail or Inbox apps. Integration

A Paging GridView with the same behavior as PagingListView.

PagingGridView PagingGridView has the ability to add more items on it like PagingListView does. Basically is a GridView with the ability to add more i

 StackExpandableView - A custom view that resembles the iOS notification group behavior
StackExpandableView - A custom view that resembles the iOS notification group behavior

StackExpandableView - A custom view that resembles the iOS notification group behavior

A powerful tool (iOS & Android) that focuses on mobile operation behavior!
A powerful tool (iOS & Android) that focuses on mobile operation behavior!

DiDiPrism,中文名:小桔棱镜,是一款专注于移动端操作行为的工具,涵盖APP操作回放、操作检测、以及数据可视化能力。我们在整个方案的实现过程中沉淀出了一套技术框架,希望可以逐步开源出来帮助更多人,同时也希望棱镜在大家的合力下能够更快的成长。 它有哪些亮点? 零入侵 业务代码无需任何适配。 高可

A snapping fling behavior for Jetpack Compose
A snapping fling behavior for Jetpack Compose

Snapper is a library which brings snapping to the Compose scrolling layouts (currently only LazyColumn and LazyRow). Check out the website for more in

Very simple SMS to API gateway

sms2api Very simple SMS to API gateway for Android devices. It's NOT Google Play compatible, due to the security restrictions but it works well on you

intera.kt is a Kotlin library for interacting with the Discord Interactions API through a gateway service or a REST API.

🗿 Overview ⚠️ WARNING: intera.kt is a work in progress. It is not yet ready for use. You may encounter bugs and other issues, but please report if yo

intera.kt is a Kotlin library for interacting with the Discord Interactions API through a gateway service or a REST API.

🗿 Overview ⚠️ WARNING: intera.kt is a work in progress. It is not yet ready for use. You may encounter bugs and other issues, but please report if yo

Spring cloud gateway with kotlin
Spring cloud gateway with kotlin

spring-cloud-gateway gradle 의존성 추가 // https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-starter-netflix-eureka-client

Spring MSA api gateway & service discovery with consul & Jaeger & Cassandra

Spring MSA api gateway & service discovery with consul & Jaeger & Cassandra

Open Super dApp - Your gateway to the new digital commons. Integrated mobile messenger, Ethereum wallet, and Web 3.0 browser built on open, decentralized, and encrypted protocols.
Open Super dApp - Your gateway to the new digital commons. Integrated mobile messenger, Ethereum wallet, and Web 3.0 browser built on open, decentralized, and encrypted protocols.

A fully open source, open standard, decentralized "super app" including a secure, encrypted Matrix compatible messenger based off of the Element Messenger, and an Ethereum crypto wallet and web3 browser based off of Alpha Wallet.

lite your android ! the code is on the way~

android-lite-auto lite your android, the code is on the way~ ! LiteAuto是一个代码生成框架,思路参考 JakeWharton 的开源项目 ButterKnife,在它的思路基础添加了一些自己的想法,从0到1设计并实现的。 Lite

TensorFlow Lite Helper for Android to help getting started with TesnorFlow.

TensorFlow Lite Helper for Android This library helps with getting started with TensorFlow Lite on Android. Inspired by TensorFlow Lite Android image

Age + Gender Estimation on Android - with TensorFlow Lite
Age + Gender Estimation on Android - with TensorFlow Lite

Age + Gender Estimation in Android with TensorFlow Contents Python project Google Colab Notebooks Dataset Model ( Vanilla vs. Lite ) Android project O

This app using Mlkit along with the TensorFlow Lite model for object detection,

I built this app using Mlkit along with the TensorFlow Lite model for object detection, Arcore is used to place anchors to the detected objects. It's a good blend of Machine learning and Augmented reality to visualise ML information in a much better way than regular bounding boxes

TensorFlow Lite Object Detection Android Demo
TensorFlow Lite Object Detection Android Demo

GSoC Project 2021 - TensorFlow Description This repository contains the project where I contributed to the TensorFlow Team during GSoC in the year 202

Android-Java-App - Notepad app with user and password. SQL Lite
Android-Java-App - Notepad app with user and password. SQL Lite

DVNote2 App Android-Java-App Notepad app with user and password Application made in Android Studio with Java language and SQLite database. How does it

Owner
Gabriel Terwesten
Gabriel Terwesten
intera.kt is a Kotlin library for interacting with the Discord Interactions API through a gateway service or a REST API.

?? Overview ⚠️ WARNING: intera.kt is a work in progress. It is not yet ready for use. You may encounter bugs and other issues, but please report if yo

Pedro Henrique 1 Nov 30, 2021
Spring cloud gateway with kotlin

spring-cloud-gateway gradle 의존성 추가 // https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-starter-netflix-eureka-client

null 1 Dec 7, 2021
Spring MSA api gateway & service discovery with consul & Jaeger & Cassandra

Spring MSA api gateway & service discovery with consul & Jaeger & Cassandra

INSUNG CHOI 2 Nov 22, 2022
Casio G-Shock Phone Sync

This app integrates the Casio G-shock B5600 series bluetooth watches, with Google services such as Google Calendar events and Google Alarm Clock. It is not meant to replace the official Casio app. Instead it converts your traditional G-shock into a semi-smart watch.

Ivo Zivkov 22 Dec 15, 2022
A Kotlin/Java library to connect directly to an Android device without an adb binary or an ADB server

dadb Blog Post: Our First Open-Source Project A Kotlin/Java library to connect directly to an Android device without an adb binary or an ADB server de

mobile.dev 791 Dec 20, 2022
A simple Kotlin class to use to connect to a MongoDB collection.

mongodb-kotlin A simple Kotlin class to use to connect to a MongoDB collection. Once you have created a MongoDB project, choose Build a Database: Next

null 2 Oct 23, 2022
Kafka Connect connector for CØSMOS based blockchains.

CØSMOS Kafka Connector Kafka Connect connector for CØSMOS based blockchains. Purpose The Kafka Connect CØSMOS Source connector is a Kafka connector us

OKP4 – Open Knowledge Protocol For 6 Nov 23, 2022
Kafka Connect JSLT Single Message Transform

This is an implementation of the Kafka Connect SMT interface to offer transformation capabilities using the Schibsted JSLT library.

willhaben 2 May 25, 2022
Therapeutic is a platform to help easily connect patients or generally anyone struggling to get through tough times with motivating content and professional therapists.

Therapeutic Apk - https://github.com/develNerd/Therapeutic/blob/main/androidApp/release/androidApp-release6.apk Therapeutic is a Kotlin Mobile Multipl

Isaac Akakpo 1 Nov 23, 2022
A lightweight Kotlin friendly wrapper around Couchbase lite for Android.

CouchBaseKtx ?? Work In-Progress ?? A lightweight Kotlin friendly wrapper around Couchbase-lite for Android Read up a little bit of documentation abou

Jaya Surya Thotapalli 5 Feb 15, 2022