Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

report timer pool exhaustion with appropriate error code #52

Merged
merged 1 commit into from
May 3, 2022

Conversation

barbibulle
Copy link
Contributor

When failing to create a timer for a new CoAP request, return the underlying error code (GG_ERROR_OUT_OF_RESOURCES) rather than GG_ERROR_OUT_OF_MEMORY.

@barbibulle barbibulle merged commit 02a8318 into master May 3, 2022
warrencomputes pushed a commit that referenced this pull request Nov 16, 2022
…e-to-newest-gg-lib to master

Squashed commit of the following:

commit 1bd659d031c3eaad70315cfb146c9dbfe15323d4
Merge: 7b73213 02a8318
Author: Mike Huovila <[email protected]>
Date:   Wed May 4 15:43:37 2022 -0700

    Merge branch 'master' of github.com:Fitbit/golden-gate into b/231325920-update-to-newest-gg-lib

commit 02a8318
Merge: cae74f8 7cc2c56
Author: Gilles Boccon-Gibod <[email protected]>
Date:   Tue May 3 09:56:03 2022 -0700

    Merge pull request #52 from Fitbit/gbg/timer-error-code

    report timer pool exhaustion with appropriate error code

commit 7cc2c56
Author: Gilles Boccon-Gibod <[email protected]>
Date:   Mon May 2 19:15:44 2022 -0700

    report timer pool exhaustion with appropriate error code

commit cae74f8
Merge: 7455178 b73f8f8
Author: Gilles Boccon-Gibod <[email protected]>
Date:   Mon Apr 18 12:41:03 2022 -0700

    Merge pull request #51 from emixb/ejarnea/ios-improve-features-

    iOS: Improvements and bug fixes

commit b73f8f8
Author: Emanuel Jarnea <[email protected]>
Date:   Mon Feb 7 10:52:04 2022 +0000

    Fix iOS build

commit 99096fa
Author: Emanuel Jarnea <[email protected]>
Date:   Wed Jun 2 07:00:00 2021 +0000

    iOS: Improvements and bug fixes

    Dont-emit-unknown-bluetooth-state

    	The new API doesn't emit unknown bluetooth states. Per Apple's docs, 'unknown' is a transient state,
    	update being imminent. By filtering out a transient state, we avoid a large number of failures.

    Bluetooth connection device discoverer

    	- Add a brand new, fully fledged Bluetooth peer discoverer, flexible enough to be used in all our iOS apps.
    	- Updated the code to use the new peer discoverer.
    	- Read device info characteristics from Bluetooth peers and display that information in the UI components.
    	- Add comprehensive unit tests for the new discoverer.
    	- Update Hub related tests.
    	- Other minor fixes and improvements.

    Use retry strategy for connection

    	- Drop duplicate reconnect strategy protocol
    	- Conform to the improved retry strategy in reconnect strategy
    	- Make the name of the reconnect strategy a bit more general, to allow it to be used in other contexts,
    	like scanning.

    Import missing frameworks. Specialise OpaquePointers where needed. Add (considerably bigger) waitUntil
    delay on flaky test.

    Identify half bond errors better

    Fix CoAP race condition

    Use-non-failing-API-for-string-to-data-conversion

    	There is a new API that converts from string to data, without returning an optional value.
    	E.g. let data: Data = "hello".data(using: .utf8)! becomes let data: Data = Data("hello".utf8)
    	This makes the codebase slightly easier to read and safer by removing the force unwrapping.

    Replay connection errors in connection controller

    	Add the ability to replay the last connection error in connection controller. This also requires making
    	the error optional to allow the subscribers know when an error condition is no longer true.
    	This change allows adding half bonded handling at endpoint level, using the transport readiness feature.

    Xcode 13.2 Support

    Update RxSwift to 6.2.0

    Make link configuration service optional in UI

    	Make link configuration service optional in UI (not all connections support link configuration)
    	Bring the latest RxBluetoothkit where a custom description has been added to some CB wrappers

    Improve link connection testability

    	Add protocols for ReadRequest and WriteRequest to allow testing logic that uses these types
    	Add handy type aliases for LinkConfiguration structs

    Emit tls session state change event together with the tls state

    	In rare occasions, reading the dtls state from GGStack would result in a crash. While I was unable
    	to reproduce the crash, it seems the issue occurs at BLE connect or disconnect and may be caused
    	by accessing deallocated C pointers. This is likely to happen due to the delay that exists between
    	the time when the tlsStateChange stack event is received and the time when the dtls status is read
    	(pointers might be freed in the time between the two steps).
    	This solution proposes combining the two steps into a single, synchronous one. Since the dtls
    	protocol element of the stack emits the tlsStateChange stack event, it's guaranteed the element
    	exists when synchronously reading the dtls state from it.

    Connection controller type erasure

    	- Create and use a type erased connection controller instead of the concrete connection controller
    	implementation. This allows stubbing the controller in unit tests.
    	- Unit tests for the type erased connection controller
    	- Add auto-connect back in GGHost

commit 7455178
Merge: a506869 cd96687
Author: Gilles Boccon-Gibod <[email protected]>
Date:   Tue Feb 8 10:10:03 2022 -0800

    Merge pull request #48 from emixb/ejarnea/if-defined-MBEDTLS_ALLOW_PRIVATE_ACCESS

    Define MBEDTLS_ALLOW_PRIVATE_ACCESS only if not already defined

commit cd96687
Author: Emanuel Jarnea <[email protected]>
Date:   Tue Feb 8 11:54:22 2022 +0200

    Define MBEDTLS_ALLOW_PRIVATE_ACCESS only if not already defined

commit a506869
Merge: 07f3f89 c806307
Author: Gilles Boccon-Gibod <[email protected]>
Date:   Mon Jan 31 16:58:23 2022 -0800

    Merge pull request #46 from Fitbit/gbg/fix-gattlink-doc

    add missing diagram

commit c806307
Author: Gilles Boccon-Gibod <[email protected]>
Date:   Mon Jan 31 13:31:17 2022 -0800

    fix a few doxygen warnings and errors

commit 53a31c0
Author: Gilles Boccon-Gibod <[email protected]>
Date:   Mon Jan 31 12:33:21 2022 -0800

    add missing diagram

commit 07f3f89
Author: Gilles Boccon-Gibod <[email protected]>
Date:   Tue Jan 25 09:34:18 2022 -0800

    Create CONTRIBUTING.md

commit acbdf7f
Merge: 056e436 44c7a08
Author: Gilles Boccon-Gibod <[email protected]>
Date:   Thu Jan 20 11:50:15 2022 -0800

    Merge pull request #42 from Fitbit/gbg/mbedtls-3-fix

    remove reference to file that was removed from mbedtls

commit 056e436
Merge: 79c7624 c8f5234
Author: bboghrati <[email protected]>
Date:   Wed Jan 19 16:39:05 2022 -0800

    Merge pull request #43 from Fitbit/bboghrati/fix-mbedtls-get-record-api-compatibility

    Accomodate for mbedTLS api changes for SSL record size getter

commit c8f5234
Author: Baktash Boghrati <[email protected]>
Date:   Wed Jan 19 14:59:58 2022 -0800

    Accomodate for mbedTLS api changes for SSL record size getter

    - Since version 2.22 `mbedtls_ssl_get_max_frag_len` is no longer supported. Yet `mbedtls_ssl_get_max_out_record_payload` has been supported since 2.13 and is available in 3.x. Uodated the compile time check to version 2.13 to use the new api for all the new versions maintaining backward compatibility.
    - Added compile time gate for mbedTLS library version log for the configs that don't have `MBEDTLS_VERSION_C` enabled.

commit 44c7a08
Author: Gilles Boccon-Gibod <[email protected]>
Date:   Wed Jan 19 10:25:28 2022 -0800

    remove reference to file that was removed from mbedtls

commit 79c7624
Merge: 086143b e435bbd
Author: Gilles Boccon-Gibod <[email protected]>
Date:   Tue Jan 18 15:32:12 2022 -0800

    Merge pull request #41 from Fitbit/gbg/mbedtls-3

    add support for building against mbedtls versions 2.x or 3.x

commit e435bbd
Author: Gilles Boccon-Gibod <[email protected]>
Date:   Tue Jan 18 12:15:03 2022 -0800

    add support for building against mbedtls versions 2.x or 3.x

commit 086143b
Merge: 76931ca ec55eb7
Author: Gilles Boccon-Gibod <[email protected]>
Date:   Wed Dec 8 08:27:16 2021 -0800

    Merge pull request #40 from Fitbit/gbg/fix-newt-repo-checkout-bug

    workaround a project install bug in newt 1.9

commit ec55eb7
Author: Gilles Boccon-Gibod <[email protected]>
Date:   Tue Dec 7 17:53:31 2021 -0800

    don't fail if the file doesn't exist

... and 8 more commits
warrencomputes pushed a commit that referenced this pull request Nov 16, 2022
…-coapendpointspec-in-g3 to master

Squashed commit of the following:

commit acb8e89bfe687765cac06d136f7b67d71609751b
Merge: 1d3f6f3 ea2a277
Author: Mike Huovila <[email protected]>
Date:   Fri Jul 29 13:57:28 2022 -0700

    Merge remote-tracking branch 'github-goldengate-remote/master' into b/235607127-flaky-coapendpointspec-in-g3

commit ea2a277
Merge: 563ce9b 6c0d3a1
Author: Mike <[email protected]>
Date:   Thu Jul 28 09:25:18 2022 -0700

    Merge pull request #58 from Fitbit/explicit-CoapEndpointSpec-endpoint-creation-thread

    Explicitly specify the thread that CoapEndpointSpec unit test creates…

commit 6c0d3a1
Author: Mike Huovila <[email protected]>
Date:   Wed Jul 27 10:59:38 2022 -0700

    Explicitly specify the thread that CoapEndpointSpec unit test creates its CoapEndpoints.
    This improves consistency of unit test runs.

commit 563ce9b
Merge: edce78a f4d2f1b
Author: Mike <[email protected]>
Date:   Mon Jul 25 17:15:57 2022 -0700

    Merge pull request #57 from Fitbit/remove-main-storyboard-from-gg-ios-host-app

    Remove main storyboard from iOS Host App

commit f4d2f1b
Author: Mike Huovila <[email protected]>
Date:   Fri Jul 22 14:30:35 2022 -0700

    Remove main storyboard from iOS Host App and programatically create root view controller.

commit edce78a
Merge: 02a8318 c59f295
Author: Radu <[email protected]>
Date:   Thu Jul 21 12:10:09 2022 +0300

    Merge pull request #55 from emixb/ejarnea/Re-add-Rxbit-fix

    Re add the temporary hack to build Rxbit

commit c59f295
Author: Emanuel Jarnea <[email protected]>
Date:   Wed Jul 20 15:14:49 2022 +0100

    Re add the temporary hack to build Rxbit

commit 02a8318
Merge: cae74f8 7cc2c56
Author: Gilles Boccon-Gibod <[email protected]>
Date:   Tue May 3 09:56:03 2022 -0700

    Merge pull request #52 from Fitbit/gbg/timer-error-code

    report timer pool exhaustion with appropriate error code

commit 7cc2c56
Author: Gilles Boccon-Gibod <[email protected]>
Date:   Mon May 2 19:15:44 2022 -0700

    report timer pool exhaustion with appropriate error code

commit cae74f8
Merge: 7455178 b73f8f8
Author: Gilles Boccon-Gibod <[email protected]>
Date:   Mon Apr 18 12:41:03 2022 -0700

    Merge pull request #51 from emixb/ejarnea/ios-improve-features-

    iOS: Improvements and bug fixes

commit b73f8f8
Author: Emanuel Jarnea <[email protected]>
Date:   Mon Feb 7 10:52:04 2022 +0000

    Fix iOS build

commit 99096fa
Author: Emanuel Jarnea <[email protected]>
Date:   Wed Jun 2 07:00:00 2021 +0000

    iOS: Improvements and bug fixes

    Dont-emit-unknown-bluetooth-state

    	The new API doesn't emit unknown bluetooth states. Per Apple's docs, 'unknown' is a transient state,
    	update being imminent. By filtering out a transient state, we avoid a large number of failures.

    Bluetooth connection device discoverer

    	- Add a brand new, fully fledged Bluetooth peer discoverer, flexible enough to be used in all our iOS apps.
    	- Updated the code to use the new peer discoverer.
    	- Read device info characteristics from Bluetooth peers and display that information in the UI components.
    	- Add comprehensive unit tests for the new discoverer.
    	- Update Hub related tests.
    	- Other minor fixes and improvements.

    Use retry strategy for connection

    	- Drop duplicate reconnect strategy protocol
    	- Conform to the improved retry strategy in reconnect strategy
    	- Make the name of the reconnect strategy a bit more general, to allow it to be used in other contexts,
    	like scanning.

    Import missing frameworks. Specialise OpaquePointers where needed. Add (considerably bigger) waitUntil
    delay on flaky test.

    Identify half bond errors better

    Fix CoAP race condition

    Use-non-failing-API-for-string-to-data-conversion

    	There is a new API that converts from string to data, without returning an optional value.
    	E.g. let data: Data = "hello".data(using: .utf8)! becomes let data: Data = Data("hello".utf8)
    	This makes the codebase slightly easier to read and safer by removing the force unwrapping.

    Replay connection errors in connection controller

    	Add the ability to replay the last connection error in connection controller. This also requires making
    	the error optional to allow the subscribers know when an error condition is no longer true.
    	This change allows adding half bonded handling at endpoint level, using the transport readiness feature.

    Xcode 13.2 Support

    Update RxSwift to 6.2.0

    Make link configuration service optional in UI

    	Make link configuration service optional in UI (not all connections support link configuration)
    	Bring the latest RxBluetoothkit where a custom description has been added to some CB wrappers

    Improve link connection testability

    	Add protocols for ReadRequest and WriteRequest to allow testing logic that uses these types
    	Add handy type aliases for LinkConfiguration structs

    Emit tls session state change event together with the tls state

    	In rare occasions, reading the dtls state from GGStack would result in a crash. While I was unable
    	to reproduce the crash, it seems the issue occurs at BLE connect or disconnect and may be caused
    	by accessing deallocated C pointers. This is likely to happen due to the delay that exists between
    	the time when the tlsStateChange stack event is received and the time when the dtls status is read
    	(pointers might be freed in the time between the two steps).
    	This solution proposes combining the two steps into a single, synchronous one. Since the dtls
    	protocol element of the stack emits the tlsStateChange stack event, it's guaranteed the element
    	exists when synchronously reading the dtls state from it.

    Connection controller type erasure

    	- Create and use a type erased connection controller instead of the concrete connection controller
    	implementation. This allows stubbing the controller in unit tests.
    	- Unit tests for the type erased connection controller
    	- Add auto-connect back in GGHost

commit 7455178
Merge: a506869 cd96687
Author: Gilles Boccon-Gibod <[email protected]>
Date:   Tue Feb 8 10:10:03 2022 -0800

    Merge pull request #48 from emixb/ejarnea/if-defined-MBEDTLS_ALLOW_PRIVATE_ACCESS

    Define MBEDTLS_ALLOW_PRIVATE_ACCESS only if not already defined

commit cd96687
Author: Emanuel Jarnea <[email protected]>
Date:   Tue Feb 8 11:54:22 2022 +0200

    Define MBEDTLS_ALLOW_PRIVATE_ACCESS only if not already defined

commit a506869
Merge: 07f3f89 c806307
Author: Gilles Boccon-Gibod <[email protected]>
Date:   Mon Jan 31 16:58:23 2022 -0800

    Merge pull request #46 from Fitbit/gbg/fix-gattlink-doc

    add missing diagram

commit c806307
Author: Gilles Boccon-Gibod <[email protected]>
Date:   Mon Jan 31 13:31:17 2022 -0800

    fix a few doxygen warnings and errors

commit 53a31c0
Author: Gilles Boccon-Gibod <[email protected]>
Date:   Mon Jan 31 12:33:21 2022 -0800

    add missing diagram

commit 07f3f89
Author: Gilles Boccon-Gibod <[email protected]>
Date:   Tue Jan 25 09:34:18 2022 -0800

    Create CONTRIBUTING.md

commit acbdf7f
Merge: 056e436 44c7a08
Author: Gilles Boccon-Gibod <[email protected]>
Date:   Thu Jan 20 11:50:15 2022 -0800

    Merge pull request #42 from Fitbit/gbg/mbedtls-3-fix

    remove reference to file that was removed from mbedtls

commit 056e436
Merge: 79c7624 c8f5234
Author: bboghrati <[email protected]>
Date:   Wed Jan 19 16:39:05 2022 -0800

    Merge pull request #43 from Fitbit/bboghrati/fix-mbedtls-get-record-api-compatibility

    Accomodate for mbedTLS api changes for SSL record size getter

... and 14 more commits
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants